Re: [PHP-DB] Weird Problem In mysql_connect(); From: Chris Hobbs (chobbs <email protected>)
Date: 08/31/01

JH has it right - your function has no idea what $host, $user, and $pass
are, because they're out of scope. Add the global statements that
Jonathan suggested inside your dbConnect function, and all will be well.

Dave Watkinson wrote:

> function dbConnect (){
> $link = mysql_connect($host,$user,$pass);
> }

And Jonathan Hilgeman correctly recommended:

> function dbConnect ()
> {
> global $host;
> global $user;
> global $pass;
> $link = mysql_connect($host,$user,$pass);
> }

-- 
                _______      ___    _  ____  _____
Chris Hobbs   / ____\ \    / / |  | |/ ___\|  __ \
Head Geek    | (___  \ \  / /| |  | | (___ | |  | |
WebMaster     \___ \  \ \/ / | |  | |\___ \| |  | |
PostMaster    ____) |  \  /  | |__| |____) | |__| |
               \____/    \/    \____/ \____/|_____/
                   http://www.silvervalley.k12.ca.us
                       chobbs <email protected>

-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>