> if ($db!="" and !@mysql_select_db($db))
> die("The site database is unavailable.");
you probably want an "or" before that die().
g.luck,
~Chris /"\
\ / Microsoft Security Specialist:
X The moron in Oxymoron.
/ \ http://www.thebackrow.net
On Fri, 26 Apr 2002, 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;
> }
> ?>
>
> ---
>
> Cheers, Ian.
> ---
> Randum Ian
> DJ / Reviewer / Webmaster, DancePortal (UK) Limited
> [EMAIL PROTECTED]
> http://www.danceportal.co.uk
> DancePortal.co.uk - Global dance music media
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php