Ok I hope I can make this clear.
I'm trying to program a friend list for my member community website. I have 2 seperate tables.
First table: Lists all the friends name's
Second table: This table is for image names that belong to each user "blah.jpg"
So this is the code I have to display the friends and their images on a member's page...
<?
$listfriends = mysql_query("SELECT * FROM friend_list WHERE uname = '$u'");
while($flist_row = mysql_fetch_array($listfriends)){
$fid = $flist_row['f_name'];
$fphoto_query .= "SELECT img_path FROM images";
$fphoto_query .= " WHERE uname = '$fid' AND main = '1'";
$fphoto_result = mysql_query("$fphoto_query");
$fphoto_name = mysql_fetch_array($fphoto_result);
$fphoto = $fphoto_name["img_path"];
print "<span class=\"med\"><img src=photos/thumbs/small/s_$fphoto><br><a href=profile.php?u=$fid><b>$fid</b></a><br>";
}
?>
I know the code is kinda messy. I have yet to clean it up, but I would like to get it working first.
I get this error message on the member page...
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home2/blah/public_html/blah/inc/blah.inc on line 553
Any ideas??