use that counter variable. check if its equal to 2 before incrementing, if
it is then "<BR>" and reset to zero, otherwise just increment.
if ($counter==2) {
echo "<BR>";
$counter=0;
} else {
$counter++;
}
marios
----- Original Message ----- Original Message -----
From: "Matt C" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, August 22, 2001 9:37 PM
Subject: [PHP-DB] Please help!
> Thats my code!
>
> What I want to be able to do is have it so instead of one column there are
> two columns of pictures:
>
>
> pic1 | pic2
> pic3 | pic4
>
> etc..
>
>
> How can I do this?
>
> Thanks in advance!
>
>
>
>
> <?php
>
> $mysql_access = mysql_connect("********", "******", "*********");
> mysql_select_db("*********", $mysql_access);
>
> $query = "SELECT * FROM Pictures";
> $result = mysql_query($query, $mysql_access);
>
> if(mysql_num_rows($result)) {
> $counter = 0;
> while($row = mysql_fetch_row($result)) {
>
> printf("<a href=\"http://www.charmed-guide.com/pictures/$row[2].jpg\"
> target=_blank>\n");
> printf("<img src=\"http://www.charmed-guide.com/pictures/$row[2]_th.jpg\"
> border=0>\n");
> printf("</a><p>\n");
>
> $counter++;
> }
>
> }
> ?>
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]