Connecting to MySQL database
Posted: Tue Dec 01, 2009 11:23 pm
Hello All,
I have a problem. I am trying to connect to a MySQL database. I have created a HTML login screen for a person (which will be me or my partner) to enter their username and password.
Here's the HTML code:
Once the person press the submit button, I want to connect to the database.
Here's the dbConfig.php code
Here is the error that I am getting:
I have been working on this for the past few days. I am using the WAMPSERVER which has apache, mysql, php. When I first started to solve the problem, I learned that I had to reconfigure my WAMPSERVER which I did (originally I couldn't access myPHPAdmin on my laptop it was saying that it was forbidden, after reconfiguring the file I can access it).
Anyway the database is stored on another website, through my school website which also has a PHPMyAdmin, but the server says: "Localhost using a UNIX socket" and the user is, "falldb_TX@localhost", while my PHPMyAdmin says "Localhost via TCP/IP" and the user for my server is saying: "root@localhost" for the username and password in the PHP code, I am putting the username and password that I use to connect to the database.
I am REALLY confused, and if someone can help that would be great.
I have a problem. I am trying to connect to a MySQL database. I have created a HTML login screen for a person (which will be me or my partner) to enter their username and password.
Here's the HTML code:
Code: Select all
<html>
<head>
<title>Login screen for ITCS 6160</title>
</head>
<body>
<form name="login_info" action="dbConfig.php" method="post">
Username: <input type="text" name="username">
<br>
Password: <input type="password" name="password">
<br>
<input type="submit" value="Submit">
</form>
</body>
</html>
Here's the dbConfig.php code
Code: Select all
<?php
$conn = mysql_connect("localhost","falldb_TX","austin");
mysql_select_db("falldb_TX");
?>
Code: Select all
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'falldb_TX'@'localhost' (using password: YES) in C:\wamp\www\Project\dbConfig.php on line 3
Anyway the database is stored on another website, through my school website which also has a PHPMyAdmin, but the server says: "Localhost using a UNIX socket" and the user is, "falldb_TX@localhost", while my PHPMyAdmin says "Localhost via TCP/IP" and the user for my server is saying: "root@localhost" for the username and password in the PHP code, I am putting the username and password that I use to connect to the database.
I am REALLY confused, and if someone can help that would be great.