Код: Выделить всё
public function getQuestions($params = "", $page = "all", $count = false){
$this->db->query('SELECT questions.questions_id, questions.question_description,
questions.question_explanation, questions.created_date,
questions.updated_date, questions.is_active,
diffLevels.difficulty_levels_title
FROM '.TBL_QUESTION.' as questions
INNER JOIN '.TBL_DIFFICULTY_LEVELS.' as diffLevels
ON questions.fk_difficulty_levels_id = diffLevels.preference
WHERE questions.is_active=1');
$Q = $this->db->get();
if ($Q->num_rows() > 0) {
foreach ($Q->result() as $row) {
$data[] = $row;
}
}
$Q->free_result();
return $data;
}
Подробнее здесь: https://stackoverflow.com/questions/447 ... odeigniter