Where can I find out more about the $db functions? How would I get the error as ErrorMsg() does not seem to work.
global $gCms;
global $db;
...
$dbresult = $db->Execute($query);
if( !$dbresult ) {
//$r .= $dbresult->ErrorMsg();
$r .= "Failure";
}
else {
$r .= "Success\r";
}
...
global $db question.
-
calguy1000
- Support Guru

- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: global $db question.
try:
(when in a module):
$db = $this->GetDb();
$dbresult = $db->Execute( $query );
if( !$dbresult )
{
$error = $db->ErrorMsg();
}
(when in a module):
$db = $this->GetDb();
$dbresult = $db->Execute( $query );
if( !$dbresult )
{
$error = $db->ErrorMsg();
}
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: global $db question.
$gCms->GetDb() doesn't exist in 0.11.2. Not to be too picky, but some people might not realize...

