I have a PHP/MySQL database. I would like to create a query editor or (query by design page). This query editor should be accessed through the browser so the user could enter a add hoc query.
For example the user needs info from the database. He would select tables and fields to query from, then sort the results.
Some of the features would be to create joins, select fields and sort using comparison operators.
I have used this feature on the server using different interfaces such as MyAdmin etc.
Is this design feature possable using PHP?
TIA
Building a PHP Query editor, HELP
Moderator: General Moderators
phpMyadmin is itself written in php.
We're in an "advanced" forum so I maybe don't need to say this but, since it seems that you will have a form to POST table names, be careful which tables you allow users to query. Mysql privileges and/or a hard-coded list of allowed tables (against which the script would check POST'd vars) would be a couple of ways to stop nastiness.
We're in an "advanced" forum so I maybe don't need to say this but, since it seems that you will have a form to POST table names, be careful which tables you allow users to query. Mysql privileges and/or a hard-coded list of allowed tables (against which the script would check POST'd vars) would be a couple of ways to stop nastiness.
To add to that, i suggest browsing open source db managers such as phpMyAdmin to see how they did what they did and how they did it so well.
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK