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
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;
finding different ways of logging onto a mySQL db.
- Original Message -
From: Erik Price [EMAIL PROTECTED]
To: Randum Ian [EMAIL PROTECTED]
Cc: PHP [EMAIL PROTECTED]
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
It helps to say what sort of trouble you're having; i.e., provide
symptoms, exact text of error messages, etc.
miguel
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;
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:
]
To: Randum Ian [EMAIL PROTECTED]
Cc: PHP [EMAIL PROTECTED]
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
On Fri, 26 Apr 2002, Chris Wesley wrote:
if ($db!= and !@mysql_select_db($db))
die(The site database is unavailable.);
you probably want an or before that die().
How would that work?
miguel
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
if( $db ){
mysql_select_db($db) or die(The site database is unavailable.);
}
To debug, use print( mysql_error ) instead of die to figure out what's
going on. It's not that far of a leap in logic.
~Chris /\
\ /
8 matches
Mail list logo