Jump to content

members login area


hullcalendar

Recommended Posts

hey guys, im new to PHP and im trying to use a login script that allows users to register and login to my site from my database.

 

on my login/register pages i get this error

 

Warning: mysql_pconnect() [function.mysql-pconnect]: Unknown MySQL server host 'host' (1) in /home/hullcale/public_html/dbConfig.php on line 12

Error connecting to database.

Warning: mysql_select_db() [function.mysql-select-db]: Access denied for user 'hullcale'@'localhost' (using password: NO) in /home/hullcale/public_html/dbConfig.php on line 20

 

Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in /home/hullcale/public_html/dbConfig.php on line 20

 

 

it seems like al my problems are from my page dbConfig.php on line 12 and 20, problem is i dont know how to edit them, here is the code from that page...

 

things you may need to know is my databse is called hullcale_database, user is Admin, password is password, as for host im not actually sure where i get this from? any tips?!

 

<?

// Replace the variable values below

// with your specific database information.

$host = "localhost";

$user = "UserName";

$pass = "Password";

$db = "dbName";

 

// This part sets up the connection to the

// database (so you don't need to reopen the connection

// again on the same page).

$ms = mysql_pconnect(host, $user, $pass);

if ( !$ms )

{

echo "Error connecting to database.\n";

}

 

// Then you need to make sure the database you want

// is selected.

mysql_select_db($db);

?>

Link to comment
Share on other sites

Line 11 should read

$ms = mysql_pconnect($host, $user, $pass);

You left of the $ before the 'host'.

 

You then edit these variables

$host = "localhost";
$user = "UserName";
$pass = "Password";
$db = "dbName";

With your database credentials. You can leave $host at it is.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.