Dear Sirs!
I would like to echo out the last iteration of a while loop differently as the first ones.
This is my code wich echos out the first and the last iteration, but I need the middle iterations as wel..
<?php
// Print
if ($row = mysql_fetch_array($result)) {
echo '["' .$row[1]. '",' .$row[2].'],';
$i++;
while ($row = mysql_fetch_array($result)){
echo '["' .$row[1]. '",' .$row[2].']';
$i++;
} // end while
} // end if
?>
The difference between the last and the other iterations is that the last doesn't contain a comma. But I need the other iterations as well, not just the first and the last ones.. Can you please help me ?
Tibor