ballhogjoni Posted July 12, 2007 Share Posted July 12, 2007 What would be the syntax of a mysql query when I want to pull the id and another specific column in a row. example: $sql = 'SELECT * FROM products WHERE id = '.$id.', boy = '.$_POST["boyGirl"]; right now I get this error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' boy =' at line 1 SQL: SELECT * FROM products WHERE id = 5, boy = in /home/realfina/public_html/thediaperbakery/inc/mysql.class.php on line 107 Link to comment https://forums.phpfreaks.com/topic/59568-mysql-syntax/ Share on other sites More sharing options...
AndyB Posted July 12, 2007 Share Posted July 12, 2007 WHERE id = '.$id.' AND boy = Link to comment https://forums.phpfreaks.com/topic/59568-mysql-syntax/#findComment-296003 Share on other sites More sharing options...
trq Posted July 12, 2007 Share Posted July 12, 2007 You are aware that there is such a thing as the MySql manual? Link to comment https://forums.phpfreaks.com/topic/59568-mysql-syntax/#findComment-296013 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.