Hi;
My continuing quest to keep my projects/life as simple as possible....
I'm trying to write a simple page that will allow my users to view the complete contents of MySQL database tables...perhaps with some filtering and/or sorting of records, but first things first.
I understand how to write a php page to show the contents of specific tables, but what I have in mind is something that will allow them to select from among a certain set of tables...which will have varying numbers of columns... and have the result page created on the fly (rather than me having to create five different pages for the five different tables).
I thought about using a two-part query system that would start with something like
$query="show columns from $TABLENAME";
...in order to get the column count and names...and then create some kind of loop using the results from that query to create the table structure and contents needed...I'm sure I could build it that way, but I'll bet there is a really, really simple way that I don't know about.
Putting data into and then getting it back out of Arrays confuses the heck out of me, but I suspect using these is the easiest thing to do.
Is there a simple, simple set of commands that will just dump the contents of a requested table into an array (including the field names) and a corresponding/simple command or set of commands that will display the array contents as a table on an .html or .php page?
And no, I don't want to give them access to phpMyAdmin...most of my users wouldn't have a clue as to where to start and the others could do too much damage.
Thanks