#21455 [Opn->Bgs]: Displaying records from mysql in a tabular form

From: Date: Mon, 06 Jan 2003 08:40:29 +0000
Subject: #21455 [Opn->Bgs]: Displaying records from mysql in a tabular form
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-29186@lists.php.net to get a copy of this message
ID: 21455 Updated by: georg@php.net Reported By: lerato101@hotmail.com -Status: Open +Status: Bogus Bug Type: MySQL related Operating System: windows 97 PHP Version: 4.2.0 New Comment: Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Thank you for your interest in PHP. Previous Comments: ------------------------------------------------------------------------ [2003-01-06 02:30:48] lerato101@hotmail.com hi! i'm a beginner in php and i've learned the below method of displaying records from mysql.i have discoverd that this method wastes space. could you please offer me any kind of help that will enable me to display the records in a table depending on the items i enter on my form.i want the names of the headings to be at the top,and then the records must follow in the rows on a table. your help will appreciated. <? $x = 0; $query = "select * from details"; $result = mysql_query($query); while($record = mysql_fetch_assoc($result)){ while(list($fieldname,$fieldvalue) = each($record)){ $x++; ?> <table width="100%" border="0" cellspacing="0" > <tr> <td bgcolor="#FFFFCC" <? echo "<font color='#000000'face='Arial' size='2'> <B>".$fieldname."</B></font> <font color='#000000' face='Geneva, Arial, Helvetica, sans-serif' size='2' ><B>".": </B></font> ".$fieldvalue."<BR></font>";?></td></tr> </table> <? } ?> <hr> <? } ?> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=21455&edit=1

« previous php.bugs (#29186) next »