I get this error for the following code, yet I have not used any AND in the code. HAve checked the curlies and parentheses for matching, and searched for answers to similar problems without success. Any help would be appreciated. Thanks in anticipation. // add a pass/fail and number of wrong answers to the student answer submission record echo "....adding PASS or FAIL to your submission record<br>"; if ($wrong_answers !=0) { // if one or more wrong answers $pf = "f" ; // set variable to f for fail $add_pass_fail = " UPDATE studentanswers SET passfail = '$pf', num_wrong = $wrong_answers WHERE id = '$last_id' "; // do query and error routine mysql_query($add_pass_fail, $conn) or die(mysql_error("Cant add PASS/FAIL status to student submission")); } PHP: I have found the error...it was with parentheses about 300 lines past where php interpreter said it was!!! Thanks
Change this $add_pass_fail = " UPDATE studentanswers SET passfail = '$pf', num_wrong = $wrong_answers WHERE id = '$last_id' "; PHP: To this $add_pass_fail = " UPDATE studentanswers SET passfail = '$pf', num_wrong = '$wrong_answers' WHERE id = '$last_id' "; PHP:
I have found the error...it was with parentheses about 300 lines past where php interpreter said it was!!! Thanks