English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

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_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

2 answers

Ya have an error using ' ' in 'batch' and 'temp', the correct statement is:

test_q = "select COUNT(batch) FROM temp WHERE batch = '$batch'" ;

Whenever you want to test your query, use "MySQL Query Browser" to test your statements in it.

2006-09-30 09:46:14 · answer #1 · answered by sonfarX 4 · 0 0

yes

2006-09-30 11:25:34 · answer #2 · answered by aadhunik.com social networking s 3 · 0 0

fedest.com, questions and answers