My code works fine unless there are Null variables in which case it dies. I got it to echo the SQL and this is what it says:
INSERT INTO NatDiary (headline, blurb, addy, email, name, appby, approved, datefrom, dateto, timefrom, timeto, venue) VALUES ('','','','','','',2,1214377200, , 1042794000, 1042794000, '')
Technical error,
You have an error in your SQL syntax near ' 1042794000, 1042794000, '')' at line 2
$sql = "INSERT INTO $tableName (headline, blurb, addy, email, name, appby, approved, datefrom, dateto, timefrom, timeto, venue)
VALUES ('$headline','$blurb','$addy','$email','$yourname','$yourname',2,
$datefrom, $dateto, $timefrom, $timeto, '$venue')";
echo $sql;
$result = mysql_query($sql)or die("Technical error, ".mysql_error());
I think the problem is if $timeto is Null.
Any ideas?
Julia