Page 1 of 1

Fatal error: Call to a member function IsConnected()

Posted: Sat Sep 16, 2006 8:02 am
by Russ
I have an enhanced {edit} admin tag which allows users to do quite a few things including backup and email the database. The backup routine uses parts of the config.php (I add some bits to the bottom) for settings etc.

To do this in my PHP I use
require_once("../include.php");
global $gCms;

This worked fine until version 1.0 when I now get an error. The backup is still created and the the e-mail sent. However, I get an error at the end of it all (my code has finished..)

Fatal error: Call to a member function IsConnected() on a non-object in /lib/classes/class.global.inc.php on line 370

I guess this is coming from the require_once above or use of global $gCms?

Can anyone help here?

Russ

Re: Fatal error: Call to a member function IsConnected()

Posted: Mon Sep 18, 2006 3:00 pm
by Piratos
require_once("../include.php");
I think you have the db twice.  remark the include and test it.

Re: Fatal error: Call to a member function IsConnected()

Posted: Mon Sep 18, 2006 3:13 pm
by Russ
Thanks for the information Piratos, if I rem out 'global $gCms;' it still works, but with the same error?
I need the 'require_once' for some config file reading and emailing.

Any other ideas?

Russ

Re: Fatal error: Call to a member function IsConnected()

Posted: Mon Sep 18, 2006 3:48 pm
by Piratos
The error is - $db is set but it has no more connection to the database , because the connection id was killed by another close.