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"; Quote 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: SELECT * FROM subjects WHERE id=' . 2' LIMIT 1 Do you really want that ' . in front of the value? Quote 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 Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.