Re: Can't Connect Within Function?!

From: Date: Mon, 01 Sep 2003 18:36:23 +0000
Subject: Re: Can't Connect Within Function?!
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-161376@lists.php.net to get a copy of this message
* Thus wrote Seth Willits (seth@freaksw.com): > If I try to connect to a database within a function, I get the > following error. Why is this? > > > MySQL Connect Error : Can't connect to local MySQL server through > socket '/Private/tmp/mysql.sock' (2) > > function getUserPermissions() { > if ($_SESSION['permissions'] == '') { > // Connecting, selecting database > $link = mysql_connect($shs_MySQLServer, $shs_MySQLUser, > $shs_MySQLPassword) Youre $shs_ vars are not defined here. Curt -- "I used to think I was indecisive, but now I'm not so sure."

« previous php.general (#161376) next »