Getting error messages


show more Getting error messages provides you with in-depth training on Developer. Taught by David Powers as part of the Accessing Databases with Object-Oriented PHP show less
please wait ...

Getting error messages

Errors are an unfortunate fact of a programmers' life. So it's important to understand how MySQL Improved reports errors. In the MySQLI object oriented interface, errors are reported as the property of an object. Connection errors are properties of the database connection object. In other words, the instance of MySQLI class used to create the connection. Errors generated by the query method are also properties of the database connection object. However, errors generated by a prepared statement are properties of the statement object.

We'll be looking at prepared statements in depth in the next chapter. There are two properties that report connection errors. We met the first one, connect error, earlier in this chapter. It provides a text description of the error. If there's no error, the property is an empty string. The other property connect_errno, contains a numerical MySQL error code. This tends to be less helpful, although it might be useful if you want to display error messages in a ...

Getting error messages
Video duration: 5m 47s 3h 47m Intermediate

Viewers:

Getting error messages provides you with in-depth training on Developer. Taught by David Powers as part of the Accessing Databases with Object-Oriented PHP

Subject:
Developer
Software:
PHP
Author:
please wait ...