Get a webpage and display it

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

jamesm87
Forum Newbie
Posts: 21
Joined: Sat May 31, 2003 1:54 pm
Location: London, UK

Post by jamesm87 »

ok thankyou for that reply.

I am having a slight problem with this script I have made...

Here is my mySQL query in PHP

Code: Select all

$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

Code: Select all

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 meant 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.

Thanks in advance :D
RTT
Forum Commoner
Posts: 38
Joined: Thu Jul 17, 2003 10:22 am
Location: Wolverhampton, UK
Contact:

Post by RTT »

you sure that query is correct? Looks a little odd to me...
jamesm87
Forum Newbie
Posts: 21
Joined: Sat May 31, 2003 1:54 pm
Location: London, UK

Post by jamesm87 »

thats why I have sent it in...lol anyway i have solved it

Code: Select all

select * from BPB_friends,BPB_online WHERE BPB_friends.friendname=BPB_online.loginname AND BPB_friends.ID = $id
Post Reply