[eluser]lennierb5[/eluser]
I am trying to display a list of data using the table & pagination library. When I run the first query the rows are counted properly and data is returned but when I use the Active Record query nothing is returned.
Is there any way to view the query codeigniter has created before executing it to see where the error is??
Here is my code:
Code:
$query = $this->db->query("
SELECT job_data.job_data_id, a_techs.tech_number, job_data.date, job_data.account_num, job_data.c_address, job_data.c_apt, job_data.job_status
FROM job_data, a_techs
WHERE job_data.tech_id = a_techs.a_techs_id
");
$total_rows = $query->num_rows();
$per_page = 20;
$query->free_result();
$this->db->select('job_data.job_data_id, a_techs.tech_number, job_data.date, job_data.account_num, job_data.c_address, job_data.c_apt, job_data.job_status');
$this->db->from('job_data, a_techs');
$this->db->where('job_data.tech_id', 'a_techs.a_techs_id');
$this->db->limit($per_page);
if ($this->uri->segment(3) !== FALSE)
{
$this->db->offset($this->uri->segment(3));
}
$query = $this->db->get();