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']}'"; Quote Link to comment 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 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.