17.07.2010, 20:42
Example.
Now if someone inputs
query would look like
which would be always true, so player could login without knowing the password.
So escaping string would return the next result
and query wouldn't be true anymore, so you couldn't login with any password.
You can read many articles about SQL injections around the internet and how to prevent them.
pawn Код:
public OnPlayerLogin(playerid, password[])
{
format(query,sizeof(query),"SELECT * FROM `players` WHERE name=SOMENAME AND password='%s'",
password);
//...
}
Quote:
|
haha' OR 'this' = 'this |
Код:
SELECT * FROM `players` WHERE name=SOMENAME AND password='haha' OR 'this' = 'this'
So escaping string would return the next result
Код:
haha\' OR \'this\' = \'this
You can read many articles about SQL injections around the internet and how to prevent them.

