Hi guys,
Can someone help me with this form. It sends the data to the db fine, but on submit it give me an error say "Error, Insert quey failed".
I'm following a tute as I'm a newbie with php, and the code looks fine but it give me the error.
<?
if(isset($_POST['add']))
{
include 'db_config.php';
include 'db_open.php';
$pilot = $_POST['pilot'];
$date = $_POST['date'];
$time = $_POST['time'];
$callsign = $_POST['callsign'];
$origin = $_POST['origin'];
$dest = $_POST['dest'];
$reg = $_POST['reg'];
$equip = $_POST['equipment'];
$duration = $_POST['duration'];
$fuel = $_POST['fuel'];
$distance = $_POST['distance'];
$filedOnline = "filedOnline.php";
$query = "INSERT INTO reports (id, date, time, callsign, origin_id, destination_id, registration, equipment, duration, fuel, distance, fsacars_rep_url) VALUES ('$pilot', '$date', '$time', '$callsign', '$origin', '$dest', '$reg', '$equip', '$duration', '$fuel', '$distance', '$filedOnline')";
mysql_query($query) or die('Error, insert query failed');
$query = "FLUSH PRIVILEGES";
mysql_query($query) or die('Error, insert query failed');
include 'db_close.php';
echo "PIREP added";
}
else
{
?>
Thanks.
Steph.