Instead of just single quotes (which must encapsulate the string unless leveraging PDO placeholders), first pass the string through mysqli_real_escape_string() function. This will take care of all escaping and sql injection issues.
Thanks. Very nice explanation. A final drop temporary table after generating the report....
Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
How to modify Temp table data for reporting
-
- Posts: 249
- Joined: Sun Dec 06, 2020 6:50 am
- Location: Chennai, India, Singapore
Re: How to modify Temp table data for reporting
Apmuthu, If my SQL SELECT statement only has the date fields as user entry fields, for this report, and my UPDATE statement is generated using only the data that my original Select statement generated, should I still have to use mysqli_real_escape_string() function? Are you suggesting that I use this on the two date fields that are user entered?apmuthu wrote:Instead of just single quotes (which must encapsulate the string unless leveraging PDO placeholders), first pass the string through mysqli_real_escape_string() function. This will take care of all escaping and sql injection issues.
Thanks. Very nice explanation. A final drop temporary table after generating the report....
How would I do that? Or what I should I do with those date fields?
Also according to Kev1n nuBuilder automatically drops the temporary tables. I've verified this by using my CPAnel myPHPAdmin. The only time temp tables are left in the database, is if my php functions fail for some reason AFTER the nuRunQuery() to create the temporary table.
-
- Posts: 249
- Joined: Sun Dec 06, 2020 6:50 am
- Location: Chennai, India, Singapore
Re: How to modify Temp table data for reporting
In the script that uses the date field values you can use the mysqli_real_escape_string() function. All user input must be washed for preventing SQL injection.
-
- Posts: 249
- Joined: Sun Dec 06, 2020 6:50 am
- Location: Chennai, India, Singapore