How can I count the numbers of rows that a MySQL query returned?

后端 未结 11 1822
北海茫月
北海茫月 2020-11-28 04:51

How can I count the number of rows that a MySQL query returned?

11条回答
  •  有刺的猬
    2020-11-28 05:39

    If you want the result plus the number of rows returned do something like this. Using PHP.

    $query = "SELECT * FROM Employee";
    $result = mysql_query($query);
    echo "There are ".mysql_num_rows($result)." Employee(s).";
    

提交回复
热议问题