At the moment i have query that echos out all the members on my site, it displays their profile picture and link to their profile page. say ive got 50 members and the query is limited to 60 then i want to fill the blank space with a default image and link to a default page, so im looking for an if statement to say if the user doesnt exist then echo out this photo and link instead?
can someone please show me where im going wrong. thanks
<?php
$user_set = get_users();
while ($users = mysql_fetch_array($user_set)) {
if (!file_exists($users)) {
$users = "data/photos/0/_default.jpg";
}
$age = age_from_dob($users['dob']);
echo "
<div class=\"sugarushcase\">
<a href=\"profile.php?id={$users['id']}\"><img width=80px height= 80px src=\"data/photos/{$users['id']}/_default.jpg\" class=\"boxgrid\"/></a><h58> {$users['first_name']} {$users['last_name']}</h58><br/><br/><h52>{$users['contact_number']}<br/><br/> ".$age.", From {$users['location']}</h52>
</div>";
}
?>