I have two columns in my database, user_id and friend_id. I want to select information if the person's id is in either one of these columns. I have the following query:
$query_num_friends = "SELECT COUNT(*) AS numrows FROM friends Where (user_id = '$_SESSION[Userid]' OR friend_id='$_SESSION[Userid]) AND confirm='Y'";
I get the following error:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/debatesp/public_html/profile/profile.php on line 298
For one particular user I have their id in the friend_id column but not in the user_id column. I have another user with information in both columns and that doesn't work either so it is definately my query. Please help so I can make it correct.
Thank you