I have a question about how to set up a page in php to allow the user to create reports from a mysql database and display in a grid on the page. I want them to build the query and save it to the another table and list on their report page to execute at anytime. I would like to give them the ability to create as many report they want and they can manage them. The site is access only and everyone has different permission levels. I have been searching but had no luck. Could someone either point me in the right direction or help me with setting up the script in php. The problem for me is setting up the build query page to pull in all the different tables and then naming the report saving it.

Thanks
Jon

Recommended Answers

All 4 Replies

I'd started by the simpliest thing...letting the user write the SQL query.
After you have the writing, saving, editing and viewing the query working good, then you can create an UI to create the report with drag & drop so the user don't have to know SQL.

You may want to save the SQL query that they create in a table, along with their user ID, creation and modification dates. This allows them to do some debugging of the query. Of course, you can go further and isolate the components of the query itself, but as a first wave, that will work.

On the output side, you will need to create the output mechanism for the. What are the types of report deliveries that they want?

Thanks for the responces, I an need a little help getting it started, I can write the query but dont know how to structural the table to save them to recall them upon click of each name of the report. I want to have the user save the query and display in a list that upon executing will display the table with the data. Any suggestions where to start with coding for php?

Hmm... The table could contain user_id and query_string. By the way, why don't you look at the page when you login to PhpMyadmin and do the 'search' part? The UI could be the same. Do NOT let users create the whole query themselves but rather allow them to enter value of each field. If you allow too much freedom, users could easily break/corrupt your database, or you will have a big headache later on to maintain the database.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.