FOUND_ROWS() keeps returning 0

前端 未结 3 712
鱼传尺愫
鱼传尺愫 2021-01-06 17:41
$result = $db_con->query(\"SELECT SQL_CALC_FOUND_ROWS * FROM users LIMIT 0,10\");

$count_result = $db_con->query(\"SELECT FOUND_ROWS() as totalcount\");
$row          


        
3条回答
  •  爱一瞬间的悲伤
    2021-01-06 18:12

    On php.net I found someone with maybe the same problem. He is speaking of a race condition that could occur: php.net. Basically he solves this problem by temporary locking the table at the cost of slowing things down.

提交回复
热议问题