hello
i have the following code
<?php
mysql_connect("localhost", "lekan", "") or die(mysql_error());
echo "connected to database";
mysql_select_db("today") or die(mysql_error());
echo "Connected to database<br>";
$tables=mysql_list_tables("today");
if ($tables ==""){
echo "this database does not have a table";
exit;
}else {
echo $tables;
}
//number of rows
$row_num = mysql_num_rows('first name');
if (!$row_num){
echo "This table does not have any row";
exit;
}
else{
echo $row_num;
}
mysql_close();
echo "Connection is closed";
?>
but rather than echo out the rows and tables this is what i get
connected to database
Connected to database
Resource id #3
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\wamp\www\database\db3.php on line 14
This table does not have any row
please can anybody tell me where i am getting it wrong. thanks alot