Jump to content

print every record as table


mrjameer

Recommended Posts

hi,

i want to fetch all records from mysql table and print every record as html table using php.but when i fetch the records,it will displays as one table only.
but i want to display one record as one table.
i dont need to print field names.
please any of your help will be appreciated.

thanks
mrjameer
Link to comment
https://forums.phpfreaks.com/topic/32578-print-every-record-as-table/
Share on other sites

After you have performed your query just do the following:

[code=php:0]
while ($record = mysql_fetch_assoc($result)) {
    echo "<table><tr>";
    echo "<td>".$record['columnname1']."</td>";
    echo "<td>".$record['columnname2']."</td>";
    echo "<td>".$record['columnname3']."</td>";
    echo </tr></table>";
}
[/code]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.