Welcome Guest, Not a member yet? Register   Sign In
Problem with Caching Queries
#1

[eluser]Unknown[/eluser]
I keep getting an "A Database Error Occurred Error Number: 1052," but the database query that it says its running is no where in my code. It's almost as if it's caching parameters from previous queries on the page and adding to.

For example, here's my model:
Code:
function get_my_total_task_count() {
    $this->db->where('status_id <', '1');
    $this->db->where('person_id', $this->session->userdata('user_id'));
    $this->db->join('exp_taskassignments', 'task_id = exp_tasks.id');
    $query = $this->db->count_all('exp_tasks');
    return $query;
}

The complete error message says:

A Database Error Occurred
Error Number: 1052
Column 'id' in field list is ambiguous
SELECT `id`, `title` FROM (`exp_teams`) JOIN `exp_taskassignments` ON `task_id` = `exp_tasks`.`id` WHERE `status_id` < '1' AND `person_id` = '1' ORDER BY `title` asc

When I comment out the function listed above, the error goes away.

I've tried
Code:
$this->db->flush_cache();
but that's not helping either.

Thanks in advance.


Messages In This Thread
Problem with Caching Queries - by El Forum - 02-15-2010, 05:40 PM
Problem with Caching Queries - by El Forum - 02-15-2010, 05:48 PM
Problem with Caching Queries - by El Forum - 02-15-2010, 05:58 PM



Theme © iAndrew 2016 - Forum software by © MyBB