Hello, I am relatively new to php so be gentle.
I had a form that was working - ie. on submit it entered the form data into my database table and directed the user to a confirmation page.
Now, I have tried the same code again, and on submit I am getting an "Error query was empty" on my confirmation page (instead of the template I designed as a "Thank You for you information" page). However, the form data IS getting inputted into the database correctly. what am I missing?! HELP please....
Here is the php code on the adapply_submit.php page: (ie. my submit_form.php code)
<?php
$con = mysql_connect("myhost","user","pw");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("mydb", $con);
$fullname = $POST['fullname'];
$email = $POST['email'];
$companyname = $POST['companyname'];
$companywebsite = $POST['companywebsite'];
$adspace = $POST['adspace'];
$length = $POST['length'];
$howlong = $POST['howlong'];
$adcreation = $POST['adcreation'];
$adtype = $POST['adtype'];
$addons = $POST['addons'];
mysql_query("INSERT INTO gmradapply2009
(fullname, email, companyname, companywebsite, adspace, length, howlong, adcreation, adtype, addons)
VALUES ('$fullname', '$email', '$companyname', '$companywebsite', '$adspace', '$length', '$howlong', '$adcreation', '$adtype', '$addons')");
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "1 record added";
mysql_close($con)
?>