ctshryock tarafından belirtildiği gibi, iyi-oluşturulmuş SQL sorgusu döndürülen değeri bir değişken seti olarak her zaman görülecektir true mantıksal bir nesne olarak gözden zaman.
Herhangi bir veri döndürdü olup olmadığını test etmek için, mysql_num_rows() PHP Documentation hangi satır numarası döndürülür dönecektir kullanabilirsiniz. Sorgu herhangi bir satır maç olmaz, o zaman bu fonksiyon if() durumuna göre false olarak görüldü olacak 0 dönmelidir.
$testresult = mysql_query( "SELECT * FROM imei359327039828680 WHERE FLD2 = '555'" );
if( !$testresult )
die( 'SQL Error' ); # The SQL Query Failed for some reason
if( mysql_num_rows( $testresult ) )
die( 'SQL Returned No Result' ); # The SQL Query returned nothing
while( $r = mysql_fetch_assoc( $testresult ) ) {
# Process your returned rows here
}