I need help with this simple PHP/MySQL Form Submission.Following is the code and error i'm getting. Everything's fine with PHP Script. It seems Mysql database connection is giving me problems.
mysql_connect("localhost","root","admin");//database connection
mysql_select_db("employees");
//inserting data order
$order = "INSERT INTO data_employees (name, address)
VALUES ('$name','$address')";
//declare in the order variable
$result = mysql_query($order); //order executes
if($result)
{
echo("<br>Input data is succeed");
} else{
echo("<br>Input data is fail");
}
Following is the ERROR Message i get: Parse error: syntax error, unexpected '?' in C:\xampp\htdocs\Input.php on line 12.
Once I fill in the form details and submit it sometimes i get errors saying "Warning: mysql_connect(): Access denied for user 'root'@'localhost' (using password: YES) in C:\xampp\htdocs\form_input.php on line 4."
"Notice: Undefined variable: name & address in C:\xampp\htdocs\form_input.php on line 11 Input data is fail".
Your solution, help is appreciated. Thank You