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
https://forums.phpfreaks.com/topic/237884-members-login-area/
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
https://forums.phpfreaks.com/topic/237884-members-login-area/#findComment-1222408
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.