On Fri, Oct 19, 2012 at 6:09 PM, admin <admin@xxxxxxxxxxxxxxxxxxx> wrote: >> -----Original Message----- >> From: Chris Payne [mailto:oxygenet32@xxxxxxxxx] >> Sent: Friday, October 19, 2012 7:01 PM >> To: <php-general@xxxxxxxxxxxxx> >> Subject: 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>"; > } Surprised no one else has jumped on the "Don't use mysql anymore" thing here. Quick and dirty PDO implementation: https://gist.github.com/3922192 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php