Re: Problems outputting to a 3 column table in order to crate an image gallery
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: Problems outputting to a 3 column table in order to crate an image gallery

From: Rik <luiheidsgoeroe@hotmail.com>
Date: Sat Apr 29 2006 - 04:57:05 CEST

Why don't I see the bumber three anywhere in the code? Have you tried making
it 3 rows? How?

But I'm in a generous mood tonight:
echo "\n<table>";
$i = 3;
while ($row = mysql_fetch_assoc($result))
{
    if($i==3) echo "\n\t<tr>";
    echo "\n\t\t<td><img src=\".$row['imagelocation']." /></td>";
    $i--;
    if($i==0) {
        echo "\n\t<tr>";
        $i = 3;
    }
}
if($i!=3) echo "\n\t\t<td colspan=\"$i\"></td>\n\t</tr>";
echo "\n</table>";

Grtz,

-- 
Rik Wasmus
Received on Mon May 1 03:07:11 2006