<?php
include('dbconnect.php');
Print "Database was found and connection was successfull!"
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$address = $_POST['address'];
$city = $_POST['city'];
$state = $_POST['state'];
$zip = $_POST['zipcode'];
$sql = "INSERT INTO `demoform` VALUES ('$fname', '$lname', '$address', '$city', '$state', '$zip')";
if(!mysql_query($sql)){
die('Error: ' . mysql_error());
}
Print "Your information has been successfully added to the database.";
?>
For some reason, my insert is not working. I keep getting this "Parse error: syntax error, unexpected T_VARIABLE in C:\xampp\htdocs\insert.php on line 5" error message.
I checked my code for any missing ({[; etc. Am I missing anything here?