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> </...
 
m preparing for archive only
 
(4 intermediate revisions by 2 users not shown)
Line 3: Line 3:


<span class="editsection" style="font-size:76%;">
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JDatabase/getErrorMsg|Edit Descripton]]<nowiki>]</nowiki>
<nowiki>[<! removed edit link to red link >]</nowiki>
</span>
</span>


{{Description:JDatabase/getErrorMsg}}
<! removed transcluded page call, red link never existed >


===Syntax===
===Syntax===
Line 43: Line 43:


<span class="editsection" style="font-size:76%;">
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[SeeAlso:JDatabase/getErrorMsg|Edit See Also]]<nowiki>]</nowiki>
<nowiki>[<! removed edit link to red link >]</nowiki>
</span>
</span>
{{SeeAlso:JDatabase/getErrorMsg}}
<! removed transcluded page call, red link never existed >


===Examples===
===Examples===
<CodeExamplesForm />
<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>
 
=== Code Examples ===
<dpl>
<dpl>
  noresultsheader=\n
  noresultsheader=\n
  category=getErrorMsg
  category=getErrorMsg
  category=JDatabase
  category=JDatabase
  category=CodeExample
  namespace=CodeExample
  category=MethodExample
  category=MethodExample
  include=*
  include=*
  format= ,,,
  format= ,,,
</dpl>
</dpl>
[[Category:Archived pages API15]]

Latest revision as of 00:26, 25 March 2017

Description

Get the error message

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

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

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

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

Code Examples