I am already using mysqli_real_escape_string
for every user input. I did try to enter the following value inside a textarea
which was later meant to be stored in the database.
Something'); DROP TABLE table_name;--
It did not delete table_name
from the database and the value was stored exactly like Something'); DROP TABLE table_name;--
in one of the tables. No character was escaped. This made me doubt if mysqli_real_escape_string
is actually working or not.
Is user input saved without escaping any characters even when we run the input through mysqli_real_escape_string
?
If the input is indeed saved with with escaped characters, why was the query saved without any changes in my case? Am I doing something wrong?