View Single Post
Old 09-14-2004, 02:43 PM   #1 (permalink)
Namraw
Registered User
 
Join Date: Sep 2004
Posts: 2
Namraw is on a distinguished road
login session help please

Hi i was tryin to use the Login Session code for my site and i got it working and everything but somethings bugging me and i dont understand whats its all about

it alwyas seems to show "Can't connect to db" even wen u can login using the user and pass i've setup i was wondering why didn't go awy or is still there cos there no point of it i think.

PHP Code:
<? 
// Login & Session example by sde 
// connect.php 

// replace with your db info 
$hostname="localhost"
$mysql_login="root"
$mysql_password=""
$database="test"

if (!(
$db mysql_connect("$hostname""$mysql_login" "$mysql_password"))) 

  print(
"Can't connect to mysql.");     

else 

  if (!(
mysql_select_db("$database",$db))) 
  { 
    print(
"Can't connect to db."); 
  } 

?>
Click here for rest of tutorial

thanks
Namraw
Namraw is offline   Reply With Quote