17.02.2013, 19:05
Escape any and all user input. That's basically it. SQL injection is done by inserting characters that have special meanings in an SQL query. Such as:
and the player inputs a "password":
Final query will look like
PHP код:
select id from players where name = '%s' and password = '%s'
PHP код:
abc'; drop table players; --
PHP код:
select id from players where name = 'aplayer' and password = 'abc'; drop table players; --'