$query = mysql_query("select * from TABLA"); $result = mysql_fetch_array($query); if(mysql_num_rows($result)==0) { echo "No hay registros"; }