right... i'm wanting to echo out my data from a mysql table but on every 2nd/3rd loop i want it to echo some extra code [</tr><tr>] anyone know how i'ld do this😕
Use a counter. When the counter reaches 2 or 3, output whatever needs to be outputted, and reset counter.
Diego
add a counter...
$cellsLeft=3; // initialize here while(list($yourDataVariables)=mysql_fetch_array($result)) { $cellsLeft--; if ($cellsLeft==0) { $cellsLeft=3; // re-initialize echo "</tr>\n<tr>"; } echo "your data here"; }
this is perfect... thanks😃