Hi all . I wonder how i check if the bold query is returning no record and if no record returned the script display the following massage and the rest of script does not execute at all. I be happy if an expert show me how.Thanks


Code:
You have no PlayLists. You Must create at least one PlayList to add songs to it, Please click here to Create a PlayList

Code:
......
$query2 = "select * from playlists where user_id='$username'";  //using user ID to get his playlist names
$result2 = mysql_query($query2) or die("Error with MySQL Statement! ".mysql_error()."<br>\nThe query was ".$query2);

//this line for dropdownbox
$option = "";


while($row2 = mysql_fetch_assoc($result2))
{

//This 2 line for drop downbox
extract ($row2);
    $option .= "<option value=\"$playlistname\">$playlistname</option>\r\n";

}    



?>
..... html and some php code later
......