Welcome Guest, Not a member yet? Register   Sign In
database Error Number: 1052
#1

[eluser]Unknown[/eluser]
Hello all
im trying to execute sql statement that retrieve data from two tables that have same column name which is id
to distinguish between the id from t_employees table i added t_employees.id in the where statement but my problem is that it does not appears in the SQL statement,what i write is:
$where=array('t_employees.id'=>$id);
but i still get the follwing error:

A Database Error Occurred

Error Number: 1052

Column 'id' in where clause is ambiguous

SELECT *, `t_employees`.`id` id FROM (`t_employees`) JOIN `t_descriptions` ON `t_descriptions`.`id` = `t_employees`.`t_descriptions_id` WHERE `id` = '24' ORDER BY `t_employees`.`id` asc
i dont know why it appears id=24 although i add t_employees.id in the where statement
can any body help me
thanks


Messages In This Thread
database Error Number: 1052 - by El Forum - 07-27-2010, 01:35 AM
database Error Number: 1052 - by El Forum - 07-27-2010, 01:43 AM
database Error Number: 1052 - by El Forum - 07-27-2010, 02:09 AM
database Error Number: 1052 - by El Forum - 07-27-2010, 07:16 AM



Theme © iAndrew 2016 - Forum software by © MyBB