Because of this:
$sql = mysql_query("INSERT INTO tbl (WHEN, WHAT, WHO) VALUES
('$WHEN','$WHAT','$WHO')");
$result = mysql_query($sql) or die("Fatal Error :".mysql_error());
...you are running the query and assigning the results into $sql and then
running mysql_query again in the line below. So the second query runs on a
result set rather than a query statement and fails. Better to do this, at
this rudimentary level:
$result = mysql_query("INSERT INTO tbl (WHEN, WHAT, WHO) VALUES
('$WHEN','$WHAT','$WHO')") or die(mysql_error());
--
http://www.web-buddha.co.uk