CyberShot Posted February 11, 2009 Share Posted February 11, 2009 Do you see anything wrong with this query? $query = "SELECT * FROM subjects WHERE id=' . $subject_id' LIMIT 1"; Link to comment https://forums.phpfreaks.com/topic/144731-solved-help-with-this-query/ Share on other sites More sharing options...
Philip Posted February 11, 2009 Share Posted February 11, 2009 If you echo that out you should see something like: Quote SELECT * FROM subjects WHERE id=' . 2' LIMIT 1 Do you really want that ' . in front of the value? Link to comment https://forums.phpfreaks.com/topic/144731-solved-help-with-this-query/#findComment-759466 Share on other sites More sharing options...
CyberShot Posted February 11, 2009 Author Share Posted February 11, 2009 I tried removing the '. and I got an error, so I put the ' back in and it worked. So instead of id='. $subject I got id=' $subject and now it works. Thanks for the help Link to comment https://forums.phpfreaks.com/topic/144731-solved-help-with-this-query/#findComment-759483 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.