blyz Posted July 16, 2007 Share Posted July 16, 2007 I am using a php authentication system on my site that also uses mysql databases. i am new to all this and i dont know what to type in this bit of code on my database.php page. $this->connection = mysql_connect(DB_SERVER, DB_USER, DB_PASS) or die(mysql_error()); mysql_select_db(DB_NAME, $this->connection) or die(mysql_error()); i know my username and password for the database and my database is just called dbtables however when i type in dbtables i get this error http://software-god.com/database.php i am using a guide here - with_Admin_Features/17/60384/index.html Thank-you. Link to comment https://forums.phpfreaks.com/topic/60219-solved-newb-help/ Share on other sites More sharing options...
GingerRobot Posted July 16, 2007 Share Posted July 16, 2007 If you are unsure of your database name and password, you'll need to contact your host. However, you say that you know your database is called dbtables. How do you know this? Do you log in somewhere(eg. phpMyAdmin) and it shows you this? If so, its likely that the username and password you enter here is the ones you need. The server will most likely be localhost. Again though, you might need to contact your host/look through their FAQs Link to comment https://forums.phpfreaks.com/topic/60219-solved-newb-help/#findComment-299551 Share on other sites More sharing options...
blyz Posted July 16, 2007 Author Share Posted July 16, 2007 yes on phpmyadmin its called dbtables. i will try what you said thanks. Link to comment https://forums.phpfreaks.com/topic/60219-solved-newb-help/#findComment-299554 Share on other sites More sharing options...
mosi Posted July 16, 2007 Share Posted July 16, 2007 try using this: DB_SERVER - localhost DB_NAME - blyz07_dbtables Link to comment https://forums.phpfreaks.com/topic/60219-solved-newb-help/#findComment-299558 Share on other sites More sharing options...
blyz Posted July 16, 2007 Author Share Posted July 16, 2007 i changed my code to this $this->connection = mysql_connect(localhost, blyz07, mypassword) or die(mysql_error()); mysql_select_db(dbtables, $this->connection) or die(mysql_error()); and i am still getting an error but a different one: Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'blyz07'@'localhost' (using password: YES) in /home/blyz07/public_html/database.php on line 28 Access denied for user 'blyz07'@'localhost' (using password: YES) anybody know what im doing wrong? Link to comment https://forums.phpfreaks.com/topic/60219-solved-newb-help/#findComment-299559 Share on other sites More sharing options...
blyz Posted July 16, 2007 Author Share Posted July 16, 2007 i am still getting an error on this line $this->connection = mysql_connect(localhost, blyz07, mypass) or die(mysql_error()); Link to comment https://forums.phpfreaks.com/topic/60219-solved-newb-help/#findComment-299565 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.