Answer the question
In order to leave comments, you need to log in
Is sql injection possible when inserting string json_encode($array, JSON_UNESCAPED_UNICODE)?
I receive data from the client and form an array. I store the array in the mysql database in the TEXT field. Insert or update with a regular string:
$string = json_encode($array, JSON_UNESCAPED_UNICODE);
$query = "UPDATE db_table SET db_field='$string'";
Answer the question
In order to leave comments, you need to log in
Clear $array with regex of all UNEXPECTED values and then check that all required values (for further work with the base) are present.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question