![]() |
Admin 3/21/2020 |
While this is possible there are a few issues there. Certainly, you can add a large text field somewhere on the page where users can enter the SQL query. |
S
|
sadisticmagician author 3/26/2020 |
While this is possible there are a few issues there. Certainly, you can add a large text field somewhere on the page where users can enter the SQL query. However, how do you prevent them from entering the SQL query that will delete some data? Also, how do you display the results, if they change the list of fields in the SQL query. Probably your best option is to let them enter the WHERE clause only and then add it to your query using the technique, explained in this article: https://xlinesoft.com/phprunner/docs/dynamic_sql_query.htm
|
![]() |
Admin 3/27/2020 |
They may not know SQL but it will take one idiot to google some SQL commands and delete all the data. |
S
|
sadisticmagician author 3/27/2020 |
They may not know SQL but it will take one idiot to google some SQL commands and delete all the data. Also, if you are creating SQL commands for them you do not need the text area, you can just use some sort of a dropdown box for this purpose. Or you can even use built-in Saved Searches option. In either case - you can output the text area control or a dropdown control using 'Insert PHP code snippet' functionality.
|