RE: [PHP] Printing MySQL into HTML Tables

From: Date: Thu, 22 Mar 2001 22:51:18 +0000
Subject: RE: [PHP] Printing MySQL into HTML Tables
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-45202@lists.php.net to get a copy of this message
modulus also works for finding even nums: if ($i % 2) { // not even } > -----Original Message----- > From: darion mapp [mailto:godd_mapp@lycos.com] > Subject: Re: [PHP] Printing MySQL into HTML Tables > > > now it seems like you know what is to be done and you are not willing to > do the work. Now i have not tested this and you may have to do some work > with it but you get the picture. if you lookup the syntax and ensure how > to use the command then you will be ok. > of course if you still have problems then let em know > > > FOR($i = 0;$i < $numrows; ++$i) > { > echo"<tr><td>$mysql_result($resultidentiferfromquery, $i, > fieldwithproduct)</td><td>$mysql_result($resultidentiferfromquery, ++$i, > fieldwithproduct)</td></tr>"; > echo"<tr><td>$mysql_result($resultidentiferfromquery, ++$i, > fieldwithproduct)</td><td>&nbsp;</td></tr>"; > if($i/2 > 0) //not even > { > > echo"<tr><td>&nbsp;</td>><td>&nbsp;</td></tr>"; > } > }

« previous php.general (#45202) next »