Work-around for PHP5's PDO rowCount MySQL issue

前端 未结 3 1407
小蘑菇
小蘑菇 2020-12-02 21:15

I\'ve recently started work on a new project using PHP5 and want to use their PDO classes for it. The problem is that the MySQL PDO Driver doesn\'t support rowCount() so the

3条回答
  •  感情败类
    2020-12-02 22:15

    This question is based on several false assumptions and one outdated statement.

    First of all, do not confuse number of affected and selected rows. PDO supported the former even back in '09.

    Speaking of number of rows returned by SELECT statement - you just don't need that number. The data you have is enough.

    And yeah, nowadays rowCount() supports number of rows selected from mysql as well. But again - you don't need that number in an average web-application anyway.

提交回复
热议问题