I am learning mysql now and one of the subjects it touches is the security issue when dealing with user input - one concern is the injection attack. I tried to duplicate the attack the book demonstrated like add a query $query = "select * from temp_table; drop table temp_table
, which I used mysqli_query($connection,$query)
. Nothing happen. I changed to use mysqli_multi_query()
and found it executed both statements. Finally I found that mysqli_query
only runs one query each time.
my question is, if I use mysqli_query
, theoretically speaking, the system shouldn't be worried on additional statement injection attack? Or, there is still any other way that the users can run additional statement even the server is using mysqli_query
?