I am pulling my hair out over here (well whats left of it). I am trying to insert form fields into my database and I cannot seem to get this working, I have searched and tried every code I could find and nothing I have tried is working.
The php code for posting
<?php
$servername = "localhost";
$username = "root";
$password = "root";
$database = "valiant_laravel";
$con = mysqli_connect($servername, $username, $password, $database);
// Check connection
if (!$con) {
die("Connection failed: " . mysqli_connect_error());
}
echo "Connected successfully";
$sql = "INSERT INTO customers (fname, lname, company, title, telephone, email, address, city, state, zip, notes )
VALUES ('$fname', '$lname', '$company', '$title', '$telephone', '$email', '$address', '$city', '$state', '$zip', '$notes')";
if (mysqli_query($con, $sql)) {
echo "New record created successfully";
} else {
echo "Error: " . $sql . "<br>" . mysqli_error($con);
}
mysqli_close($con);
?>
And the top of the form line looks like
<form enctype="multipart/form-data" action="" method="post" name="add_customer" id="add_customer" class="form-horizontal">
I know this has been asked 100 times, but I did search and like I mentioned, nothing I have tried has worked.
Thanks in advance.