[Help] MySQL insert query (error)
#1

I have an error in MySQL insert query:
Код HTML:
ERROR:CMySQLQuery::Execute[OnPlayerRegister]
MESSAGE:(error #1054) Unknown column 'email' in 'field list'
Part of the code:
Код:
new 
        query[512], hashed_pass[129];

WP_Hash(hashed_pass, sizeof(hashed_pass), PlayerData[playerid][Password]);

mysql_format(MySQL_Handle, query, sizeof query, "INSERT INTO `players` SET \
    `name` = '%e',\
    `email` = '%e',\
    `password` = '%s',\
    `country` = '%d',\
    `age` = '%d'", 
PlayerData[playerid][Name], PlayerData[playerid][Email], hashed_pass, 
PlayerData[playerid][Country], PlayerData[playerid][Age]);

mysql_tquery(MySQL_Handle, query, "OnPlayerRegister", "d", playerid);
What is the problem? I tried to throw 'email' field, but the error was not repair, it is still there, but this time for 'country' field.

DB structure of `players` table:
Reply
#2

The format of INSERT INTO is:
Код:
INSERT INTO table (String1, String2, Int1...) VALUES ('%e', '%e', %i)
Reply
#3

Quote:
Originally Posted by Stinged
Посмотреть сообщение
The format of INSERT INTO is:
Код:
INSERT INTO table (String1, String2, Int1...) VALUES ('%e', '%e', %i)
I know, but and with this format, same error is happend.
Reply
#4

Quote:
Originally Posted by Stinged
Посмотреть сообщение
The format of INSERT INTO is:
Код:
INSERT INTO table (String1, String2, Int1...) VALUES ('%e', '%e', %i)
Read this post no 2 https://sampforum.blast.hk/showthread.php?tid=609261&page=3
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)