I'm trying to add a new record into my database using SQl and PHP with an ODBC coection. When I complete the form and click 'add', nothing happens! Here is my code:
if(isset($_POST['add'])){
$co=odbc_coect($data_source,$user,$password);
$Address1 = $_POST['Address1'];
$Address2 = $_POST['Address2'];
$Address3 = $_POST['Address3'];
$Address5 = $_POST['Address5'];
$contactName = $_POST['contactName'];
$pic = $_POST['pic'];
$emailAddress = $_POST['emailAddress'];
$number = $_POST['number'];
$pname = $_POST['pname'];
$type = $_POST['type'];
$emailAddress = $_POST['storage'];
$number = $_POST['allergen'];
$phama = $_POST['phama'];
$health = $_POST['health'];
$qp = $_POST['qp'];
$transport = $_POST['transport'];
$qac = $_POST['qac'];
$qad = $_POST['qad'];
$stmt = "INSERT INTO dbo.tblVersions2 (QuoteNumber, Address1, Address2, Address3, Address4, ContactName, PositionInCompany, EmailAddress, TelephoneNumber, ProductName, TypeOfService, StorageConditions, AllergenInfo) VALUES(NULL, '$Address1',
'$Address2', '$Address3', '$Address4', '$Address5', '$contactName', '$pic', '$emailAddress', '$number', '$pname', '$type', '$storage',
'$allergen')";
$result = odbc_execute($co, $stmt);
if($result){
echo "New Product Added";
}
else {
echo "Product not Added";
}
}
?>
Please help me find out what's wrong, thank you!
