unemployment Posted April 1, 2011 Share Posted April 1, 2011 I have a MySQL syntax error. Anyone know why? $sql = "SELECT `user_id`, `friend_id` WHERE `user_id` OR `friend_id` = '${user_info['uid']}'"; UPDATE: hmmm I'm guessing I forgot FROM UPDATE: My OR is still not working $sql = "SELECT `user_id`, `friend_id` FROM `partners` WHERE `user_id` OR `friend_id` = '${user_info['uid']}'"; Link to comment https://forums.phpfreaks.com/topic/232408-syntax-error/ Share on other sites More sharing options...
kenrbnsn Posted April 1, 2011 Share Posted April 1, 2011 You need a condition on each piece of the WHERE, try: <?php $sql = "SELECT `user_id`, `friend_id` FROM `partners` WHERE `user_id` = '${user_info['uid']}' OR `friend_id` = '${user_info['uid']}'"; ?> Ken Link to comment https://forums.phpfreaks.com/topic/232408-syntax-error/#findComment-1195529 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.