View Single Post
Old 04-18-2005, 09:35 PM   #9 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,489
sde is on a distinguished road
i mean on wherever your php scripts that are trying to connect to mysql are.

now, i just noticed something else, .. your mysql_select_db() should take a second argument, $dbh in this case.

try using this code for your connection. of course, replace the variables with your data:
PHP Code:
<?
$hostname
="localhost";
$mysql_login="myusername";
$mysql_password="mypassword";
$database="mydatabase";

// connect to the database server
if (!($db mysql_pconnect($hostname$mysql_login $mysql_password))){
  die(
"Can't connect to database server: ".mysql_error());    
}else{
  
// select a database
    
if (!(mysql_select_db("$database",$db))){
      die(
"Can't connect to database: ".mysql_error());
    }
}
?>
__________________
Mike
sde is offline   Reply With Quote