RE: [PHP] Table help needed

From: Date: Fri, 19 Oct 2012 23:09:32 +0000
Subject: RE: [PHP] Table help needed
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-319521@lists.php.net to get a copy of this message
> -----Original Message----- > From: Chris Payne [mailto:oxygenet32@gmail.com] > Sent: Friday, October 19, 2012 7:01 PM > To: <php-general@lists.php.net> > Subject: [PHP] Table help needed > > Hi everyone, > > So i'm stuck, and I admit it. I have to (QUICKLY) display information > from a database, easy. But the formatting they want is in a HTML > table, 3 columns at a time and unlimited rows - how can I display 3 > columns across at a time? Please help, it's a last minute thing !!! > > Chris $query = "SELECT * TABLE"; $result = mysql_query($query); If(mysql_num_rows($result) >= 1) { Echo "<table>"; While($row = mysql_fetch_assoc($result)) { Echo "<TR><TD>".$row[field1]."</TD><TD>".$row[field2]."</TD><TD>".$row[field3]."< /TD></TR> } Echo "</table>"; }

« previous php.general (#319521) next »