聘我网

新概念招聘3.0

得到一个MySQL的result,怎么获取其中的结果数?

vote up0vote downstar
$sql = 'select ...';

$result = mysql_query($sql,$con);

前提是不能用mysql_fetch_assoc($result)等遍历,因为要留着后面做这件事

 

1 个答复

vote up0vote downcheck

mysql_num_rows()

Retrieves the number of rows from a result set. This command is only valid for statements like SELECT or SHOW that return an actual result set. To retrieve the number of rows affected by a INSERT, UPDATE, REPLACE or DELETE query, use mysqlaffectedrows().

链接

您的回答





不是您要找的问题? 浏览其他含有标签 的问题或者 自己问个.