Hi,
I am a total novice, trying to just return a count from a table, but I keep getting a Resource id #3, I see this is a common problem but I dont understand stuff I have read to know how to modify my code.
<?php
require('LogbookSearchConfig.php');
$db=MYSQL_CONNECT($hostname, $username, $password) OR DIE("Unable to connect to database");
@mysql_select_db("$dbName") OR DIE(error(mysql_error()));
$call = isset($_POST['call']) ? $_POST['call'] : '';
$MyCall = isset($_POST['MyCall']) ? $_POST['MyCall'] : '';
$cate = isset($_POST['cate']) ? $_POST['cate'] : '';
if ($call == "")
{$call = '';}
if ($MyCall == "")
{$MyCall = '';}
$query = 'SELECT count(*) FROM `OnlineLogBook` WHERE date >= \'2013/01/01\'';
$result = @MYSQL_QUERY($query);
$num_rows = @mysql_num_rows($result);
echo "$result";
MYSQL_CLOSE($db);
exit;
?>
I know the SQL works but getting the number out into a webpage is defeating me!!!
Help!
regards
Bob