OK, New question. I changed the form so that the information is submitted from a different page (Effectively, it just looks up the information from the query on p. 1 and returns all the values on p. 2), so that problem is solved…
NOW, I cannot get the sql to INSERT INTO… It keeps returning the “Record not Inserted” message. I have checked all my syntax, I think it is right.
<?php
session_start();
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert</title>
</head>
<body>
<?php
require('connect.php');
$CompanyName = $_POST['CompanyName'];
$FirstName = $_POST['FirstName'];
$LastName = $_POST['LastName'];
$Adress = $_POST['Address'];
$City = $_POST['City'];
$State = $_POST['State'];
$ZipCode = $_POST['ZipCode'];
$Office = $_POST['Office #'];
$Home = $_POST['Home #'];
$Cell = $_POST['Cell #'];
$Fax = $_POST['Fax #'];
$CompanyEmail = $_POST['CompanyEmail'];
$PersonalEmail = $_POST['PersonalEmail'];
$BillingType = $_POST['BillingType'];
$NetDays = $_POST['NetDays'];
$BillingContact = $_POST['BillingContact'];
$BillingAddress = $_POST['BillingAddress'];
$BillingCity = $_POST['BillingCity'];
$BillingState = $_POST['BillingState'];
$BillingZip = $_POST['BillingZip'];
$BillingPhone = $_POST['BillingPhone'];
$BillingEmail = $_POST['BillingEmail'];
$PreferredRate = $_POST['PreferredRate'];
$ReferredBy = $_POST['ReferredBy'];
$ReferralDiscount = $_POST['ReferralDiscount'];
$AssurancePlan = $_POST['AssurancePlan'];
$AssuranceLevel = $_POST['AssuranceLevel'];
$sql = "INSERT INTO Customer (CompanyName, FirstName, LastName, Address, City, State, ZipCode, Office#, Home#, Cell#, Fax#, CompanyEmail, PersonalEmail, BillingType, NetDays, BillingContact, BillingAddress, BillingCity, BillingState, BillingZip, BillingPhone, BillingEmail, PreferredRate, ReferredBy, ReferralDiscount, AssurancePlan, AssuranceLevel) VALUES ('$CompanyName', '$FirstName', '$LastName', '$Address', '$City', '$State', '$ZipCode', '$Office', '$Home', '$Cell', '$Fax', '$CompanyEmail', '$PersonalEmail', '$BillingType', '$NetDays', '$BillingContact', '$BillingAddress', '$BillingCity', '$BillingState', '$BillingZip', '$BillingPhone', '$BillingEmail', '$PreferredRate', '$ReferredBy', '$ReferralDiscount', '$AssurancePlan', '$AssuranceLevel')";
if ($conn->query($sql) === TRUE) {
echo "<script type='text/javascript'> alert('Customer Created'); </script>";"
echo "<script type='text/javascript'> document.location = 'Main.php'; </script>";
} else {
echo "<script type='text/javascript'> alert('Record Not Inserted'); </script>";
echo "<script type='text/javascript'> document.location = 'customer.php'; </script>";
}
?>
</body>
</html>
And I can’t seem to be able to stop this reply box from actually running script, any help with that would also be appreciated!