26.06.2017, 06:23
Hello, my problem is system register and login.
Please, help me.
errors:
INQUIRY:
Please, help me.
errors:
Код:
[Sun Jun 25 17:20:47 2017] ------------------------- [Sun Jun 25 17:20:47 2017] Logging Started [Sun Jun 25 17:20:47 2017] ------------------------- [Sun Jun 25 17:20:47 2017] Connected (0) to root @ localhost via TCP/IP. [Sun Jun 25 17:20:47 2017] MySQL Server Version 5.5.5-10.1.21-MariaDB. [Sun Jun 25 17:20:52 2017] Error (0): Failed to exeute query. You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'FROM players WHERE nickname='root_.' LIMIT 1' at line 1. [Sun Jun 25 17:20:52 2017] Error (0): Function: mysql_store_result called when no prior successful query executed. You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'FROM players WHERE nickname='root_.' LIMIT 1' at line 1. [Sun Jun 25 17:20:52 2017] Error (0): Function: mysql_store_result called when no result stored. You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'FROM players WHERE nickname='root_.' LIMIT 1' at line 1.
Код:
mysql_real_escape_string(PlayerData[playerid][nickname], esc_nickname); mysql_real_escape_string(password, esc_password); format(s_buf, sizeof(s_buf), "SELECT password = SHA1(CONCAT(salt, SHA1(CONCAT(salt, '%s')))) AS valid FROM players WHERE nickname = '%s' LIMIT 1;", esc_password, esc_nickname); printf(s_buf); mysql_query(s_buf); mysql_store_result(); new valid=mysql_fetch_int(); mysql_free_result();