Hello, i am trying to run 2 sql queries on a page but only the first one works the queries are correct because if i change the order it is always the one on top that runs and the other one won't run, it doesn't show any error or anything, does anyone know why does this happen? here is the code..
PHP Code:
$ctime = time(); $ttime = strtotime($row['date'] . " " . $row['time']); $diff = $ttime - $ctime; if ($diff < 0) { $diff = 0 - $diff; $passed_time = $diff; $past = true; // if passed time is 40 min and task is 1 send chat to supervisor if ($passed_time > 7200 && $dismiss == "no" && $task == "1"){ $msg = "Counselor ". $counselor. " has not done task: ".$task_name." for case $case_no ."; $sql = "INSERT INTO chat VALUES('','$admin_id',$user_id,'".$msg."','".time()."','0','0')"; $exe = mysql_query($sql); if(!$exe){echo mysql_error();} $sqlu = "UPDATE task_manager_cases SET dismiss = 'yes' where `case_#` = '$case_no'"; $exec = mysql_query($sqlu); if(!$exec){echo mysql_error();} }
here the chat is sent to the supervisor but i need to update the column dismiss to no so the chat won't appear again, i only need the chat to be sent once, and the reason why it will appear again is because the page refreshes every 5 min. thanks
Last edited by stivens; 09-21-2011 at 03:59 PM..
|