I have the following code that gets all escorts that are featured. What I want to add is if there are no escorts that are featured show my image say youradhere.jpg 5 times since I'm limiting the results to 5. I would apprecaite any help or ideas on this.. AND YES ITS AN INTERESTING WEBSITE...
$queryfeatured = mysql_query("SELECT * FROM userinfo, user WHERE (userinfo.category1='Female Escorts' OR userinfo.category2='Female Escorts') $paypalstatus AND userinfo.status='Approved' AND userinfo.id = user.id AND userinfo.featured='Yes' GROUP BY user.id LIMIT 5");
while ($getfeatured = mysql_fetch_array($queryfeatured)){
$getimgs = mysql_query("SELECT * FROM images WHERE id=$getfeatured[id] AND status='Approved' GROUP BY thumb ORDER BY RAND() LIMIT 1");
$imgsfetch = mysql_fetch_assoc($getimgs);
echo " ";
echo "<a href=\"$sitefilestartname"."-female-escorts.php?username=$getfeatured[username]\"><font size=\"2\" face=\"serif\"><img src='" . "http://www.mysite.com/customerimages/thumb/" . $imgsfetch['thumb'] . "' alt=\"$getfeatured[username]\"></a>";
}