The columnCount() method returns the number of columns in the result set prepared by the statement.
This is extremely useful when writing generic data display functions where you do not know in advance how many
columns the query will return. The method works directly on the prepared statement object after its execution.
Practical Application: The columnCount method is used when building dynamic reports
or when you want to verify if the query returned the expected number of data fields. Check the process at home by
following these steps:
pdo_db database and the users table with records
exist.