Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision |
pdo:get_row_count [2016/10/14 08:47] – created peter | pdo:get_row_count [2020/07/15 09:30] (current) – external edit 127.0.0.1 |
---|
</code> | </code> |
| |
**NOTE**: Though the documentation says this method is only for returning affected rows from UPDATE, INSERT, DELETE queries, with the PDO_MYSQL driver (and this driver only) you can get the row count for SELECT queries. Keep this in mind when writing code for multiple databases. | **NOTE**: Though the documentation says this method is only for returning affected rows from //UPDATE, INSERT, DELETE// queries, with the **PDO_MYSQL** driver (and this driver only) you can get the row count for SELECT queries. Keep this in mind when writing code for multiple databases. |
| |
This is because MySQL's protocol is one of the very few that give this information to the client for SELECT statements. Most other database vendors don't bother divulging this information to the client as it would incur more overhead in their implementations. | This is because MySQL's protocol is one of the very few that give this information to the client for SELECT statements. Most other database vendors don't bother divulging this information to the client as it would incur more overhead in their implementations. |
| |