Fatal error: Call to a member function IsConnected()

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
Russ
Power Poster
Power Poster
Posts: 813
Joined: Fri Nov 25, 2005 5:02 pm
Location: North West England

Fatal error: Call to a member function IsConnected()

Post 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
Piratos

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

Post by Piratos »

require_once("../include.php");
I think you have the db twice.  remark the include and test it.
Russ
Power Poster
Power Poster
Posts: 813
Joined: Fri Nov 25, 2005 5:02 pm
Location: North West England

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

Post 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
Piratos

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

Post 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.
Post Reply

Return to “Developers Discussion”