project3 Posted February 6, 2008 Share Posted February 6, 2008 Im having problems with a select statement. I have a db table (ticket) with sid as on of the fields. when I use WHERE `sid` = $id; I get the error. Column 'sid' in where clause is ambiguous when I use WHERE `ticket.sid` = $id; I get there error. Unknown column 'ticket.sid' in 'where clause' what am i doing wrong? Quote Link to comment Share on other sites More sharing options...
Stooney Posted February 6, 2008 Share Posted February 6, 2008 $query="SELECT * FROM ticket WHERE sid='$id'"; Quote Link to comment Share on other sites More sharing options...
project3 Posted February 6, 2008 Author Share Posted February 6, 2008 $query="SELECT * FROM ticket WHERE sid='$id'"; that does not make a difference. Quote Link to comment Share on other sites More sharing options...
Stooney Posted February 6, 2008 Share Posted February 6, 2008 does it give the same error? If so then the column just doesn't exist. Quote Link to comment Share on other sites More sharing options...
mmarif4u Posted February 6, 2008 Share Posted February 6, 2008 Please post ur whole code. Quote Link to comment Share on other sites More sharing options...
project3 Posted February 6, 2008 Author Share Posted February 6, 2008 does it give the same error? If so then the column just doesn't exist. it does, i figured it out though. it needed to be `ticket`.`sid` instead of `ticket.sid` Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.