Re: How to pass connection as global variable ?

From: Date: Wed, 11 Jul 2007 07:56:50 +0000
Subject: Re: How to pass connection as global variable ?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-258596@lists.php.net to get a copy of this message
C.R.Vegelin wrote:
I have various PHP scripts that use the same database. The startup script default.php sets the connection once for all the scripts. This connection is set in $_SESSION to make it a global variable for all scripts. When switching from page default to page faq, I get errors I can't explain. Any help is highly appreciated. TIA, Cor default.php ---------------- <?php session_start(); require("menu.php");
<snip>
faq.php ----------- <?php require("menu.php");
The first two lines give it away ;) You're missing a session_start(). -- Postgresql & php tutorials http://www.designmagick.com/

« previous php.general (#258596) next »