[REVIEW] database->getErrorMsg

Last reviewed: Not reviewed
phpDocumentor

database->getErrorMsg

Returns the most recent database error message.  See also database->stderr.

Syntax

string getErrorMsg ( )

Examples

Example:

$query = "SELECT * FROM 'bad_table'";
$database->setQuery( $query );
$rows = $database->loadObjectList();
if ($database->getErrorNum()) {
  echo $database->getErrorMsg();
}

which would output:

You have an error in your SQL syntax near \'\'bad_table\'\' at line 1 SQL=SELECT * FROM \'bad_table\'
 

Please report any errors on this page to the Developer Documentation Forum.

Last Updated ( Monday, 25 December 2006 )