Run MySQL query script to see if the query returns no results using mysql_num_rows function in PHP.
PHP Code:
<?php
global $db;
$sql = "SELECT event_id FROM cesei_activity"
$result = mysql_query($sql, $db);
if(mysql_num_rows($result)!=0){
echo 'Number of rows returned = '.mysql_num_rows($result);
} else{
echo "No row returned";
}
?>
global $db;
$sql = "SELECT event_id FROM cesei_activity"
$result = mysql_query($sql, $db);
if(mysql_num_rows($result)!=0){
echo 'Number of rows returned = '.mysql_num_rows($result);
} else{
echo "No row returned";
}
?>
No comments:
Post a Comment