|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-01-06 02:40 UTC] georg@php.net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 22 12:00:01 2025 UTC |
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> <? } ?>