Page 1 of 1
best method to get all data
Posted: Tue Jun 07, 2005 11:22 pm
by jaymoore_299
what's the best way to:
1. retrieve all data in a table
2. display the data retrieved so that it looks as it is stored.
Posted: Wed Jun 08, 2005 7:49 am
by feyd
Code: Select all
SELECT * FROM `table`
[*]a standard html table works well. For the most part, you can blindly display each column in a cell. The only real check you may want to do is check if a field is NULL. You can use [url=http://php.net/function.array_keys]array_keys()[/url] with the result from [url=http://php.net/function.mysql_fetch_assoc]mysql_fetch_assoc()[/url] to display the field names as the table header. Alternately, you can do a [url=http://dev.mysql.com/doc/mysql/en/describe.html]DESCRIBE[/url] to do some proportional calculations and type setting to fiddle with how it looks.[/list]