Codice PHP:
if(mysql_num_rows($result) != 0){
while(
$array=mysql_fetch_array($result)){
//esegui il while
}