Answer the question
In order to leave comments, you need to log in
How to do SQL injection on MY server?
I decided to learn how to protect myself from SQL injections.
I immediately tried to test it on my server. There is a query that gets a user from the database by his id:
SELECT * FROM `users` WHERE `id` = '{$_POST['id']}'
. If you substitute id 1, you get .
How can you perform a SQL injection by getting a user with id 2 as well? SELECT * FROM `users` WHERE `id` = '1'
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question