MYSQL_NUM_ROWS

wxdqz

New Member
Hello,

Need help for a stupid mySQL problem.
I've a table in a db called report
It stores all searches done in a search engine based on a Database.
When someone does a search the string he's searched for goes in table report.
Now, I need to create a back office page where I can read all searches done ordered by number
I.E. if sport has been searched for 40 times and sex for 30 times it should return me
sport (40)
sex (30)
based on the number of rows in which it find sport.

I've tried this

<?
$db = mysql_connect("$mysqlserver","$mysqluser","$mysqlpass");
mysql_select_db($dbname,$db);
$query = mysql_query("SELECT Count(string),string FROM report GROUP BY string;");
while($row=mysql_fetch_array($query)){
print ("<FONT face=\"$font_face\"><B>".$row["string"]."</B></FONT><BR>\n");

}
?>

but it returns me string only without counting for string number....
Any ideas?


thanks
 
Back
Top