Reply to Re: Strange results from foreach loop

Your name:

Reply:


Posted by Pedro Graca on 10/26/06 23:17

stat_holyday@hotmail.com wrote:
> The script below works great, but with a
> strange bug that seems impossible to me.

Take a piece of paper and a pen(cil).
Make four columns for your variables.
Follow the code ...

For the example, assume I renamed the variables

$qc = $question_count;
$qi = $question_id;
$n = $number;

Example:

$qc | $qi | $n | $status |
3 | 2 | 1 | | => $question_id == $number | *NO*
| | | | $question_count < $number | *NO*
| | | | $question_count > $number | *YES*
| | | "" | ==> q1.gif
| | 2 | "" | => $question_id == $number | *YES*
| | | "_selected" | ==> q1_selected.gif
| | 3 | "_selected" | => $question_id == $number | *NO*
| | | | $question_count < $number | *NO*
| | | | $question_count > $number | *NO*
| | | | ==> q1_selected.gif
| | 4 | "_selected" | => $question_id == $number | *NO*
| | | | $question_count < $number | *YES*
| | | "_blank" | ==> q1_blank.gif

--
I (almost) never check the dodgeit address.
If you *really* need to mail me, use the address in the Reply-To
header with a message in *plain* *text* *without* *attachments*.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация