Problem with INSERT query
#1

I'm trying to INSERT value to MySQL table i get strange error. Can't seem to fix it.
Код:
 [ERROR] CMySQLQuery::Execute[] - (error #1054) Unknown column 'e' in 'field list
Код:
format(oldname, 24, pInfo[targetid][Name]);
format(pInfo[targetid][Name], 24, inputtext);

format(string, sizeof(string), "INSERT INTO namechanges(PlayerSQL, OldName, NewName) VALUES(%d, %e, %e)", pInfo[targetid][ID], pInfo[targetid][Name], oldname);
mysql_tquery(SQL, string);
Reply
#2

PHP код:
format(stringsizeof(string), "INSERT INTO namechanges (PlayerSQL, OldName, NewName) VALUES (%d, '%e', '%e')"pInfo[targetid][ID], pInfo[targetid][Name], oldname); 
When it doesn't work then you can try this:
PHP код:
mysql_format(SQL,stringsizeof(string), "INSERT INTO namechanges (PlayerSQL, OldName, NewName) VALUES (%d, '%e', '%e')"pInfo[targetid][ID], pInfo[targetid][Name], oldname); 
Reply
#3

Now it shows
Код:
[ERROR] CMySQLQuery::Execute[] - (error #1054) Unknown column 'NAME_I_INSERTED' in 'field list'
Reply
#4

Anyone?
Reply
#5

INSERT INTO `namechanges` (`PlayerSQL`, `OldName`, `NewName`) VALUES ('%d', '%e', '%e')
Reply
#6

Something very strange with it. Now i got new error, tried to increase query size but nothing.
Код:
[ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''namechanges'('PlayerSQL', 'OldName', 'NewName') VALUES('8', 'Glen_Johnson','Dra' at line 1
Reply
#7

Fixed it with solution below. Never had used quotes in mysql, but with R39 it seems im forced to do so.
Код:
mysql_format(SQL, string, sizeof(string), "INSERT INTO namechanges(PlayerSQL, OldName, NewName) VALUES('%d', '%e','%e')", pInfo[targetid][ID], pInfo[targetid][Name], oldname);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)