JDatabase/getErrorMsg: Difference between revisions
From Joomla! Documentation
New page: ===Description===
Get the error message
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki>
</... |
|||
| Line 58: | Line 58: | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
===Source Body=== | |||
<source lang="php"> | |||
$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; | |||
</source> | |||
Revision as of 16:29, 10 May 2010
Description
Get the error message
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;