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. Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment 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? Quote Link to comment 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()); Quote Link to comment 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.