Here is my mySQL query in PHP
$sql="select * from BPB_friends,BPB_online where BPB_friends.friendname=BPB_online.loginname id=('$id') ";
$result=mysql_query($sql);
$num = mysql_num_rows($result);
And each time it gives off this error
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/hollyfie/bpb/friend.php on line 9
The script is ment to be a friends list, so in each table
BPB_friends:
ID (ID of the owner of the friends list
freindsname (Name of the friend name added)
block (is this person blocked?)
BPB_online
ID (The Friend added ID)
loginname (the friend added name)
online (the friend added online or not)
any idea's to fix it or to make it better and easier.