Re: Please help!

From: Date: Wed, 22 Aug 2001 19:56:41 +0000
Subject: Re: Please help!
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-11683@lists.php.net to get a copy of this message
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" <matthewcothier@hotmail.com> To: <php-db@lists.php.net> 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: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.db (#11683) next »