API15

API15:JDatabase/getErrorMsg

From Joomla! Documentation

Description

Get the error message

[Edit Descripton]

Template:Description:JDatabase/getErrorMsg

Syntax

getErrorMsg($escaped=false)
Parameter Name Default Value Description
$escaped false

Returns

string The error message for the most recent query

Defined in

libraries/joomla/database/database.php

Importing

jimport( 'joomla.database.database' );

Source Body

function getErrorMsg($escaped = false)
{
        if($escaped) {
                return addslashes($this->_errorMsg);
        } else {
                return $this->_errorMsg;
        }
}

[Edit See Also] Template:SeeAlso:JDatabase/getErrorMsg

Examples

<CodeExamplesForm />


Source Body

$deposito = new stdClass();
$deposito->id =$id;
$deposito->estado = $estado;
$this->_db->updateObject('#__tabla',$deposito,'id',false);
if ($this->_db->getErrorNum()) {  
    echo $this->_db->getErrorMsg();  
    return false;  
}
return true;