如果查询存在,如果不存在,则回显这个吗?

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>";
        }
    ?> 

Something along the lines of the following?

<?php


    $user_set = get_users();
    $user_count = mysql_num_rows($user_set);
    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>";

    }

    // if there were less than 60 users we need some default profiles to fill the spaces
    if($user_count < 60){
        // how many default spaces do we need?
        $default_profiles_needed = 60 - $user_count;        
        for($i = 1; $i <= $default_profiles_needed; $i++){
            echo "<div class=\"sugarushcase\">
                    <a href=\"default.php\">
                        <img width=80px height= 80px src=\"default.jpg\" class=\"boxgrid\"/>
                    </a>
                </div>";
        }
    }


?> 

you may look for this

   <?php
    $user_set = get_users();
    if (!$user_set) {

                 $users = "data/photos/0/_default.jpg";
                   }
                   else {
    while ($users = mysql_fetch_array($user_set)) {


    $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>";
    } }
?>