Hey there,
I'm getting this error:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'ODBC'@'localhost' (using password: NO)
My php code is as follows:
<?php
$con = mysql_connect("localhost","$username","$password"); //Replace with your actual MySQL DB Username and Password
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("formindb", $con); //Replace with your MySQL DB Name
$name=mysql_real_escape_string($POST['name']); //This value has to be the same as in the HTML form file
$email=mysql_real_escape_string($POST['email']); //This value has to be the same as in the HTML form file
$sql="INSERT INTO formindb (name,email) VALUES ('$name','$email')"; /*form_data is the name of the MySQL table where the form data will be saved.
name and email are the respective table fields*/
if (!mysql_query($sql,$con)) {
die('Error: ' . mysql_error());
}
echo "The form data was successfully added to your database.";
mysql_close($con);
?>
I'm very green. I recently installed XAMPP.
What am I doing wrong?
Thanks so much!
Beth