PHP check for empty results in while loop

I have this WHILE loop:

$sql = “SELECT * FROM supImages WHERE deleted = ‘no’”;
$result = mysql_db_query(‘uisd’, $sql) or die(“Couldn’t get file list”);

while($row = mysql_fetch_array($result))
{
	$data = ($row["data"]);
                    echo $data;
         }

In the database if there is rows set DELETED = ‘no’, ECHO $DATA will show something, and thats good. Now, what if there is no DELETED = ‘yes’. What if all the rows for column DELETED are set to YES. Then $data would be empty.

I want to make an IF statement to display “There is no files” in case all DELETED are set to YES. THis is what I did, but doesnt work:

	if(empty($data))
	{
	echo ('<p>There is no images to display.</p>');
	echo ('<a href="process.php?id=$id>Click here to add pictures</a>');
	}

Any suggestions?