MySQL Register/Login system problems
#5

try edit:

pawn Код:
format(string, sizeof(string), "SELECT * FROM 'users' WHERE 'username' = '%s'", name);
to:
format(string, sizeof(string), "SELECT * FROM `users` WHERE `username` = '%s'", name);

format(string, sizeof(string), "INSERT INTO 'users' ('username', 'password') VALUES ('%s', '%s')", name, inputtext);
to:
format(string, sizeof(string), "INSERT INTO `users` (username, `password`) VALUES ('%s', '%s')", name, inputtext);

format(string, sizeof(string), "SELECT * FROM 'users' WHERE 'username' = '%s' AND 'password' = '%s'", name, inputtext);
to:
format(string, sizeof(string), "SELECT * FROM `users` WHERE `username` = '%s' AND `password` = '%s'", name, inputtext);
edit: btw better to use MD5 coding for passwords, for example:
pawn Код:
format(string, sizeof(string), "INSERT INTO `users` (username, `password`) VALUES ('%s', MD5('%s'))", name, inputtext);

format(string, sizeof(string), "SELECT * FROM `users` WHERE `username` = '%s' AND `password` = MD5('%s')", name, inputtext);
Reply


Messages In This Thread
MySQL Register/Login system problems - by Tomer!.$ - 04.09.2013, 10:07
Re: MySQL Register/Login system problems - by Army - 04.09.2013, 10:30
Re: MySQL Register/Login system problems - by Tomer!.$ - 04.09.2013, 10:37
Re: MySQL Register/Login system problems - by Vince - 04.09.2013, 10:43
Re: MySQL Register/Login system problems - by Army - 04.09.2013, 10:46
Re: MySQL Register/Login system problems - by Tomer!.$ - 04.09.2013, 10:49
Re: MySQL Register/Login system problems - by Dragonsaurus - 04.09.2013, 10:50

Forum Jump:


Users browsing this thread: 1 Guest(s)