⇧
vadnica-logo
My Services About the Project Telegram O meni O meni

Determining the Number of Rows with the rowCount() Method

The rowCount() method returns the number of rows affected by the last SQL statement (e.g., how many rows were deleted, updated, or inserted). When used with SELECT statements, most drivers (including MySQL) return the number of rows found by the query. This is extremely useful when you want to verify if a search was successful before attempting to output any data.

EXAMPLE
RESULT
The result will be displayed here...

Practical Application: This method is called on the prepared statement object (PDOStatement) after executing the execute() command. Check the process at home by following these steps: