I’m building a part of a system where the user can define “views” from a mysql database.
I want some way of generating simple HTML tables/reports from the data, but not just plain output of sql queries- simple joins probably isn’t enough.
Any ideas?
Just to be clear: I know perfectly well how to create a HTML table with PHP/MySQL – that is the simple part. What I want to do is allow my USERS to create their own tables without being exposed to the process!
Right, i’ll give some more details- thanks for all the responses:
Currently users can create tables using a wizard, then view/edit/delete records in these tables. This makes it difficult to give an example as tables could change. The data I expect the client to input is for renting houses- a table of houses, tenants, rooms, maintenance issues etc.
What I aim to enable the user to do is to create some basic formatted output of a particular view, for example “show rent turnover in the current month for all houses” or “show overdue tenants” or “show rooms with no tenants”. Once set up, these will only be viewed, not edited, so the process just has to be bearable to set up.
Does that make sense? If it’s not possible I’ll just hard-code the views- just makes the system less flexible!
You have to define the way users will create those HTML tables. Do they setup a number of rows and columns, then feed the table manually ?
Once we had to do a templating system where all images, css properties, positionning of various html blocks, etc. The whole system was 5 or 6 mysql tables just to store the templates properties, but if it’s just a table you can ease the process.
Imagine one mysql table for table format and properties (row count, col count, col width, colors, etc.) and another mysql table for data to put inside. This second table should have columns for storing date, row and col positions.
The rest is all making a form accessible to non-tech users to configure and feed table, and render table with some PHP loops and queries.