|
Posted by Jim Michaels on 11/18/50 11:43
"Simon" <spambucket@example.com> wrote in message
news:48pkm4Fl87tlU1@individual.net...
> >
>> I have the same kind of construct which didn't get an error at lines
>> 134-153.
>> if ($row2['ra_id_given_id']!=0) {
>> $q3=mysql_query("SELECT * FROM quiz_report_questions WHERE
>> rq_id=$row2[ra_id_given_id]", $link);
>> $row3=mysql_fetch_array($q3);
>> if ($row2['correct_ra_id']!=0) {
>> $q4=mysql_query("SELECT * FROM quiz_report_answers WHERE
>> ra_id=$row2[correct_ra_id]", $link);
>> $row4=mysql_fetch_array($q4);
>> if ($row4['answer_tag']==$row3['answer_tag']) {
>> $ncorrect++;
>> } else {
>> $nwrong++;
>> }
>> } else { //bad test
>> $bad=true;
>> }
>> } else { // user gave no answer. doesn't matter if no answer
>> available.
>> if ($row2['correct_ra_id']!=0) {
>> //answer available. consider it wrong. don't even have to look
>> it up.
>> $nwrong++;
>> }
>> }
>> }
>>
>
> You have already been told by Disco Octopus what the problem is, (did you
> even read his reply?).
> Look at the code bellow and it will show you where the error is.
>
> if ($row2['ra_id_given_id']!=0)
> {
> $q3=mysql_query("SELECT * FROM quiz_report_questions WHERE
> rq_id=$row2[ra_id_given_id]", $link);
> $row3=mysql_fetch_array($q3);
> if ($row2['correct_ra_id']!=0)
> {
> $q4=mysql_query("SELECT * FROM quiz_report_answers WHERE
> ra_id=$row2[correct_ra_id]", $link);
> $row4=mysql_fetch_array($q4);
> if ($row4['answer_tag']==$row3['answer_tag'])
> {
> $ncorrect++;
> }
> else
> {
> $nwrong++;
> }
> }
> else
> { //bad test
> $bad=true;
> }
> ////////////////////////////////////////////////////
> // this else has no if!!!!
> ////////////////////////////////////////////////////
> }
> else
> { // user gave no answer. doesn't matter if no answer available.
> if ($row2['correct_ra_id']!=0)
> {
> //answer available. consider it wrong. don't even have to look
> it up.
> $nwrong++;
> }
> }
> }
see the if statement if ($row2['correct_ra_id']!=0) { for the one
with the comment "bad test". it's obvious.
for the one without the comment below your /////////// see if
($row2['ra_id_given_id']!=0) { it goes with the one with the comment "user
gave no answer". brackets match. already checked many times. I printed
the code out and drew lines between the curly brackets to make sure my if
statements were correct, and checked them with a brace checker.
it turns out I am not the only one to cause the interpreter to crash with
this "unexpected T_ELSE" error message (causes VC6 JIT debugger to come up).
there is a bug logged at php.net. the first guy didn't give his full code
so the bug report didn't go very far.
the last curly brace came from the end of a while() statement so it's bogus.
I did find an echo line around line 306 that didn't have a semicolon. (4.3.8
didn't give me an error about a missing else or case statement) I
discovered that because I used 4.3.8 to execute it. and then after I fixed
that bug, 4.3.8 hung and I can't kill it. maybe it's because of the
sessions or mysql being used in conjection with command-line (sessions?).
>
> And in my experience, "(?!?interpreter bug?)" usually means that you are
> wrong.
>
> Simon
> --
> http://urlkick.com/
> Free URL redirection service. Turns a long URL into a much shorter one.
>
[Back to original message]
|