I think its this, I don't have my codes at work with me, doing it out of my head now.
$piccount = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_gallery WHERE uid='".$chat[0]."'"));
if ($piccount[0]>0){
$photo = mysql_fetch_array(mysql_query("SELECT imageurl FROM ibwf_gallery WHERE uid='".$chat[0]."' ORDER BY RAND() "));}else{
$photo[0] = "defaultpic.jpg";
}
echo "<img src=\"$photo[0]\" width=\"50\" height=\"60\" alt=\"$photo[0]\"/>";
echo "[$ds]<a href=\"chat.php?action=say2&sid=$sid&who=$ chat[0]&rid=$rid&rpw=$rpw\">$optlink</a> - ";
echo "".strtolower($tosay)."
";
$piccount = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_gallery WHERE uid='".$chat[0]."'"));
if ($piccount[0]>0){
$photo = mysql_fetch_array(mysql_query("SELECT imageurl FROM ibwf_gallery WHERE uid='".$chat[0]."' ORDER BY RAND() "));}else{
$photo[0] = "defaultpic.jpg";
}
echo "<img src=\"$photo[0]\" width=\"50\" height=\"60\" alt=\"$photo[0]\"/>";
echo "[$ds]<a href=\"chat.php?action=say2&sid=$sid&who=$ chat[0]&rid=$rid&rpw=$rpw\">$optlink</a> - ";
echo "".strtolower($tosay)."
";
Comment