Evert Ulises German Soto - 2011-02-28 18:23:13 - In reply to message 1 from RicardoSaracino
PDOStatement::rowCount() returns the number of rows affected by a DELETE, INSERT, or UPDATE statement.
Not works in Select Statement...
For most databases, PDOStatement::rowCount() does not return the number of rows affected by a SELECT statement. Instead, use PDO::query() to issue a SELECT COUNT(*) statement with the same predicates as your intended SELECT statement, then use PDOStatement::fetchColumn() to retrieve the number of rows that will be returned. Your application can then perform the correct action.