====== getErrorMsg ======
{#JAPI Joomla.Framework Database JDatabase::getErrorMsg #}
Returns the most recent database error message. See also [[JDatabase-stderr|JDatabase->stderr]].
===== Syntax =====
string getErrorMsg ()
===== Examples =====
$database =& JFactory::getDBO();
$query = "SELECT * FROM 'bad_table'";
$database->setQuery( $query );
$rows = $database->loadObjectList();
if ($database->getErrorNum()) {
echo $database->getErrorMsg();
}
might produce:
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~~