I'm trying to setup a system where if you are looking at your own profile you can't friend yourself, and if you're on another persons profile you can. The issue is I get this error.
Warning: mysql_num_rows() expects parameter 1 to be resource, string given in C:\xampp\htdocs\profile.php on line 60
if($user['id'] != $my_id) {
mysql_connect('localhost', 'root', '');
mysql_select_db('All Connected');
$profile_id = $user['id'];
$check_friend_query = mysql_query("SELECT id FROM friends WHERE (user_one='$my_id' AND user_two='$profile_id') OR (user_one='$profile_id' AND user_two='$my_id')");
if(mysql_num_rows($check_friend_query) == 1){
echo "<a href='#' class='box'>You Are Already Friends!</a>";
} else {
echo "<a href='#' class='box'>Send Friend Request!</a>";
}
}