Re: Query in a function

From: Date: Tue, 19 Jun 2001 16:52:37 +0000
Subject: Re: Query in a function
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-9630@lists.php.net to get a copy of this message
At 19.06.2001 09:21, you wrote:
Hello I have a query that I have placed in a function that is in a file that I "include" in the page to be displayed. It doesn't work. I know that the code works because when I place the code in the page to be displayed directly it works fine. I can't figure it out. Thanks in advance for any help. John Here is the function contained in lib.inc: function type_select() { $connection = mysql_connect($server, $user, $pass);
are $server, $user and $pass global variables? If not, they wouldn't be available inside the function and you'd either have to make them global, or pass them to the function. That could explain why you can't connect... -- Andreas D Landmark / noXtension Real Time, adj.: Here and now, as opposed to fake time, which only occurs there and then.

« previous php.db (#9630) next »