I am Web developer, but I don't understand something, I did search and asked many but they know it is just there but the don't give me a technical answer:
Main Question :
Howwonder how SQL Injectioninjection works through URL with SQL in the parameter?
Description :
. Assume I have database and in thea database I havewith a table named mytable and whenmytable
. When I get idan ID from method POST I put it in this query:
SELECT * FROM `mytable` WHERE id='POST[id]'
Even if the user putputs SQL like : SELECT * FROM 'mytable'
SELECT * FROM 'mytable'
It became something like this:
SELECT * FROM `mytable` WHERE id='SELECT * FROM 'mytable'
So it just returns :
You have an error in your SQL syntax.
So I just think How thesehow does this kind of attack works work?
How theycan the attacker change the query to pass Syntax Error without causing a syntax error?