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

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

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

11条回答
  •  盖世英雄少女心
    2020-11-28 05:28

    SELECT SQL_CALC_FOUND_ROWS *
    FROM   table1
    WHERE  ...;
    
    SELECT FOUND_ROWS();
    

    FOUND_ROWS() must be called immediately after the query.

提交回复
热议问题