Re: Code Troubles

From: Date: Fri, 26 Apr 2002 16:26:36 +0000
Subject: Re: Code Troubles
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-94744@lists.php.net to get a copy of this message
The trouble I got with it is the code is chucking back the "The site database is unavailable." error and it is indeed available. I have used other scripts at the same time and they are pumping it back. It is not a way of coding I have used before and wondered if it was the code? I am simply finding different ways of logging onto a mySQL db. ----- Original Message ----- From: "Erik Price" <pricee@hhbrown.com> To: "Randum Ian" <ian@danceportal.co.uk> Cc: "PHP" <php-general@lists.php.net> Sent: Friday, April 26, 2002 5:21 PM Subject: Re: [PHP] Code Troubles > > On Friday, April 26, 2002, at 12:20 PM, Randum Ian wrote: > > > Hi all, Im having trouble with this code, can anyone help? > > > > --- > > > > <?php // db.php > > > > $dbhost = "localhost"; > > $dbuser = "dancepo_db"; > > $dbpass = "database"; > > > > function dbConnect($db="dancepo_db") { > > global $dbhost, $dbuser, $dbpass; > > > > $dbcnx = @mysql_connect($dbhost, $dbuser, $dbpass) > > or die("The site database appears to be down."); > > > > if ($db!="" and !@mysql_select_db($db)) > > die("The site database is unavailable."); > > > > return $dbcnx; > > } > > ?> > > Well, you've simply defined a few variables and then a function. Do you > expect it to do something? > > Show us the context in which this function is used. > > > Erik > > > > ---- > > Erik Price > Web Developer Temp > Media Lab, H.H. Brown > pricee@hhbrown.com > > >

« previous php.general (#94744) next »