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

Detailed Error Inspection with errorInfo()

The errorInfo() method returns an array containing detailed information about the last operation performed on the database or statement object. The array contains three elements: the standard SQLSTATE code (index 0), the driver-specific error code (index 1), and the driver-specific error message string (index 2). This is the most powerful tool for determining exactly why a query failed.

EXAMPLE
RESULT
The result will be displayed here...

Practical Application: We use the errorInfo method during development to quickly read the message returned to us by MySQL (e.g., "Unknown column in field list"). Check the process at home by following these steps: