Topic: Forms in PHP and MySql
Hi,
I am trying to write code for an online form in php and mysql so that the form information will be collected in a database in phpmyadmin.
The code is working locally (when I use localhost) but it is not working online when I upload the form onto my website. Can you please tell me what the problem is?
Thank you very much.
Form php code:
$name = $_POST['name'];
$company = $_POST['company'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$address = $_POST['address'];
mysql_connect("localhost", "root", "my_password") or die('Error: '.mysql_error());
mysql_select_db("olympic_support");
$query="INSERT INTO reseller_pack (name,company,phone,email,address) VALUES ('$_POST[name]','$_POST[company]','$_POST[phone]','$_POST[email]','$_POST[address]')";
mysql_query($query) or die('Error updating database');
echo "Database updated";When I try to run the page on my website, I am getting the following error:
Warning: mysql_connect(): Access denied for user 'root'@'localhost' (using password: YES) in /home/exquip/www/olympicsupport.com/resellerform.php on line 63
Error: Access denied for user 'root'@'localhost' (using password: YES)
