开发者

Mysql how many search results

开发者 https://www.devze.com 2022-12-09 03:15 出处:网络
How can I check how many results is returned from mysql db? Im using this code to fill a table with results from the mysql db:

How can I check how many results is returned from mysql db?

Im using this code to fill a table with results from the mysql db:

   $qry_result = mysql_quer开发者_JAVA百科y($query) or die(mysql_error());
   while($row = mysql_fetch_array($qry_result))

Im want to display how many search results there was on the users search criteria...

Thanks


Use mysql_num_rows.

$num_of_results = mysql_num_rows($qry_result);

It works for SELECT or SHOw. If the query is INSERT, UPDATE, REPLACE or DELETE use mysql_rows_affected.

0

精彩评论

暂无评论...
验证码 换一张
取 消