hullcalendar Posted May 30, 2011 Share Posted May 30, 2011 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); ?> Quote Link to comment https://forums.phpfreaks.com/topic/237884-members-login-area/ Share on other sites More sharing options...
mikesta707 Posted May 30, 2011 Share Posted May 30, 2011 um.. change your $user variable to Admin and your $password variable to password? Before you do this though, I suggest you read up a little more on PHP/Mysql Quote Link to comment https://forums.phpfreaks.com/topic/237884-members-login-area/#findComment-1222403 Share on other sites More sharing options...
wildteen88 Posted May 30, 2011 Share Posted May 30, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/237884-members-login-area/#findComment-1222408 Share on other sites More sharing options...
hullcalendar Posted May 30, 2011 Author Share Posted May 30, 2011 im not getting any errors at the moment, however i cant login or register or anything. not sure if i connected it to the database properly! any ideas?! Quote Link to comment https://forums.phpfreaks.com/topic/237884-members-login-area/#findComment-1222486 Share on other sites More sharing options...
wildteen88 Posted May 30, 2011 Share Posted May 30, 2011 however i cant login or register or anything What is the code use for these actions? Quote Link to comment https://forums.phpfreaks.com/topic/237884-members-login-area/#findComment-1222488 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.