
Prepared statement with variable number of parameters
- or -
Post a project like this980
£20(approx. $27)
- Posted:
- Proposals: 4
- Remote
- #3919300
- Awarded
Description
Experience Level: Entry
I need a secure prepared statement which will have a variable number of parameters to bind variables. The code needs to be safe from sql injection, and very secure.
My form is submitted via AJAX, the prepared statement is on PHP page called by AJAX. The form is long and many of the questions are optional and may not be answered by the user. I only want to query the table based on the inputs that the user has answered.
For example:
I have several dynamically created checkboxes with the same name (but different values) in my form. Depending on which are checked by the user, I need to query the database for only the checkbox values selected PLUS whichever other form elements the user has selected.
My form is submitted via AJAX, the prepared statement is on PHP page called by AJAX. The form is long and many of the questions are optional and may not be answered by the user. I only want to query the table based on the inputs that the user has answered.
For example:
I have several dynamically created checkboxes with the same name (but different values) in my form. Depending on which are checked by the user, I need to query the database for only the checkbox values selected PLUS whichever other form elements the user has selected.
Adrian M.
99% (36)Projects Completed
29
Freelancers worked with
28
Projects awarded
30%
Last project
22 Apr 2025
United Kingdom
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies