API15

JDatabase/getErrorMsg: Difference between revisions

From Joomla! Documentation

Doxiki (talk | contribs)
New page: ===Description=== Get the error message <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki> </...
 
4ng3r (talk | contribs)
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

[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;