I'm having a problem with mysql_connect(). Here is the code I am using:
function db_connect() {
global $dbhost, $dbusername, $dbuserpassword, $default_dbname;
global $MYSQL_ERRNO, $MYSQL_ERROR;
$link_id = mysql_connect($dbhost, $dbusername, $dbuserpassword);
if(!$link_id) {
$MYSQL_ERRNO = 0;
$MYSQL_ERROR = "Connection failed to the host $dbhost.";
return 0;
}
else if(!mysql_select_db($dbname)) {
$MYSQL_ERRNO = mysql_errno();
$MYSQL_ERROR = mysql_error();
return 0;
}
else return $link_id;
}
The problem is, that it completely hangs up and times out. I use this
code on many diff websites and servers, but on this particular server
and site, this happens. I have never done anything else on this server,
so I was thinking it might be the settings, but I'm not even sure where
to start. Usually I just get back error message such as invalid password
or user etc....but this completely hangs and times out, just on the
mysql_connect() alone. If I take that out, the page loads up fine, but
of course I can't do any MySQL work. Any help would be appreciated and I
thank you in advance :)
-Chris
****************************
Christopher Moreno
Web Developer
http://www.chaosad2000.com
****************************
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php