Using bind parameters to secure query.
Using bind parameters to secure query.
davykiash
Posts: 35Questions: 13Answers: 1
Hello
I have been using direct value approach in my where clause in the query on the server which is not secure at all.
->where( 'my_field', $my_value, '=' )
How can I use the parameter approach , something almost similar to almost this?
->where( 'my_field', ':my_value', '=' );
->bind( 'my_value',$value);
This question has accepted answers - jump to:
This discussion has been closed.
Answers
I had a similar question here: https://datatables.net/forums/discussion/42001/bind-on-where-paramete it turn out you do not need to bind because it is alreeady done for you. If you had:
then you would have to bind.
This is secure. It will automatically be bound for you as @INTONE says.
Allan