PDA

View Full Version : Rows



Robbie
15-02-2007, 01:28 PM
I have a rarevalues script and it shows all the rares on a page, using this


while ($row = mysql_fetch_array($res))
{
echo "<td><font face=\"Verdana\" size=\"1\"><p align=\"center\"><img src=\"$row[image]\" alt=\"Value Added on $row[date]\"><br>$row[title]</a> </td>";
}

how can i get it so it goes

VALUE VALUE VALUE VALUE VALUE VALUE

then

VALUE VALUE VALUE VALUE VALUE VALUE

6 items per row

Thanks

nets
15-02-2007, 02:20 PM
while ($row = mysql_fetch_array($res)) {
$buffer[] = "<td><font face=\"Verdana\" size=\"1\"><p align=\"center\"><img src=\"$row[image]\" alt=\"Value Added on $row[date]\"><br>$row[title]</a> </td>";
if(count($buffer)==6) {
echo '<tr>'.implode(' ', $buffer).'</tr>';
unset($buffer);
}
}

Robbie
15-02-2007, 03:32 PM
Didn't work :(
Gets to 6 then doesnt display any more


while ($row = mysql_fetch_array($res)) {
$buffer[] = "<td><font face=\"Verdana\" size=\"1\"><p align=\"center\"><img
src=\"$row[image]\" alt=\"Value Added on $row[date]\"><br>$row[title]</a> </td>";
if(count($buffer)==6) {
echo '<tr>'.implode(' ', $buffer).'</tr>';
unset($buffer);
}
}

nets
15-02-2007, 04:47 PM
Sorry, your demonstration gave the impression that you were going to have precisely 6 results on each row. To output the remaining data, put this after the while loop.


if(isset($buffer)) echo '<tr>'.implode(' ', $buffer).'</tr>';

Want to hide these adverts? Register an account for free!