Empty line allows script to run
Posted: Fri Nov 07, 2003 12:56 pm
I Have just had having an hour trying to make a script run and then by putting an extra line in it works OK. It is just a simple script to insert a record in to MySQL. Can anyone explain why this may be? Have a look at the codes:
working code
non working code
WaDaYaThink
working code
Code: Select all
$job_id = mysql_insert_id();
$sql="INSERT INTO actions (job_id, user_id, action_time, action_notes)
VALUES ('$job_id', '$user_id', '$today', '$action_notes')";
mysql_query($sql) or die('An error occured executing sql statement. SQL='.$sql.'<br>'.mysql_error());Code: Select all
$job_id = mysql_insert_id();
$sql="INSERT INTO actions (job_id, user_id, action_time, action_notes)
VALUES ('$job_id', '$user_id', '$today', '$action_notes')";
mysql_query($sql) or die('An error occured executing sql statement. SQL='.$sql.'<br>'.mysql_error());