I have a table and I want to run a count query in it. The table contains numbers, some different and some similar, and I want to run a COUNT for a particular number to see how many times it appears in the table. I am using it with php with the following query command
$test_q = "select COUNT('batch') FROM `temp` WHERE `batch` = '$batch'" ;
$test_r = mysql_query($test_q);
$test_r1 = $test_r;
echo " The number appears '$test_r' times !"; ?>
When the script is executed, I am always getting this error
"Resource id #300"
in place of the COUNT result. Can u help me to tackle this please. Thank you.
2006-09-30
04:23:46
·
2 answers
·
asked by
Nadeem
2
in
Computers & Internet
➔ Programming & Design