Support Joomla!

references:joomla.framework:database:jdatabase-geterrormsg

Table of Contents

getErrorMsg

API Package Subpackage Class Method Reference Last reviewed Doc status
API Home Package Joomla.Framework Subpackage Database Class JDatabase Method getErrorMsg Reference getErrorMsg() Never Work in Progress

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

Syntax

string getErrorMsg ()

Examples

Example

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

might produce:

Result

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''bad_table'' at line 1 SQL=SELECT * FROM 'bad_table'

Discussion

Full name:
E-Mail:
 
references/joomla.framework/database/jdatabase-geterrormsg.txt (792 views) · Last modified: 2007/08/15 14:52