Problem with updating (MySQL R33)
#1

Hey,

I'm trying to finish with my MySQL based house system, and I came across a problem. This is the error that I get in the debug,

Код:
[14:42:49] [DEBUG] CMySQLQuery::CMySQLQuery() - constructor called
[14:42:49] [DEBUG] mysql_tquery - scheduling query "UPDATE `houses` SET `Owned`=1, `Owner`=itsDanny WHERE `ID` = '6'"..
[14:42:49] [DEBUG] CMySQLQuery::Execute[()] - starting query execution
[14:42:49] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'itsDanny' in 'field list'
[14:42:49] [DEBUG] CMySQLQuery::Execute[()] - error will be triggered in OnQueryError
[14:42:49] [DEBUG] CMySQLQuery::Execute[()] - data being passed to ProcessCallbacks()
[14:42:49] [DEBUG] Calling callback "OnQueryError"..
[14:42:49] [DEBUG] CMySQLQuery::~CMySQLQuery() - deconstructor called
This happens after I buy a house. I don't see anything wrong with the code. Anyway, here it is:

Код:
hInfo[id][Owned] = 1;
                hInfo[id][Owner] = Name[playerid];

				mysql_format(mysql, query, sizeof(query), "UPDATE `"HouseTable"` SET `Owned`=%i, `Owner`=%e WHERE `ID` = '%i'", hInfo[id][Owned], hInfo[id][Owner], id);
				mysql_tquery(mysql, query, "", "");
Thanks
Reply
#2

Write it like this:

Код:
"UPDATE `HouseTable` SET `Owned`='%i', `Owner`='%e' WHERE `ID` = '%i'"
Greekz
Reply
#3

Quote:
Originally Posted by Kaliber
Посмотреть сообщение
Write it like this:

Код:
"UPDATE `HouseTable` SET `Owned`='%i', `Owner`='%e' WHERE `ID` = '%i'"
Greekz
No, that's not the problem. I've defined the table name so I have to use the speech marks (" ")
Reply
#4

Give this a shot:
Код:
	mysql_format(mysql, query, sizeof(query), "UPDATE `"HouseTable"` SET `Owned`='%i', `Owner`='%e' WHERE `ID` = '%i'", hInfo[id][Owned], hInfo[id][Owner], id);
	mysql_tquery(mysql, query);
Most likely you are not setting a limit for the strings inside the query, and thus considering it a field.
Reply
#5

Owner is a string field, try what people are posting and it will work...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)