If you remove the if() and always print both level, stage and the name then are they in the correct order?
In some cases maybe there will be a gap in level (for example not having anyone at lvl 4 but some at both 3 and 5)? Then this would be better.
PHP Code:
$pre_level = 0; // Assuming there is no level zero, if there is set it to -1 instead $pre_stage = 0; while ( ... ) { // some code here if ($level > $pre_level) { // print new level and new stage $pre_level = $level; $pre_stage = $stage; } elseif ($stage > $pre_stage) { // print same level again with new stage $pre_stage = $stage; } // print the name }
__________________
Your answers will only be as good as your question. Formulate it well and give all the necessary information.
Last edited by lizciz; 08-09-2009 at 06:24 AM..
|