Posts: 1,018
Threads: 320
Joined: Jul 2010
20.05.2014, 14:38
(
Последний раз редактировалось Luca12; 20.05.2014 в 15:18.
)
Hello I was trying to update when player disconnect from server then I update some text to variable PlayerInfo[playerid][OffBanReason] and I put NoReason to be updated in mysql column OffBanReason and then I go to disconnect and in mysql log says
(error #1054) Unknown column 'NoReason' in 'field list'
Why is that happening. Thanks
here is that on onplayerdisconnect
pawn Код:
if(PlayerInfo[playerid][OffBaned] == 0)
{
strmid(PlayerInfo[playerid][OffBanReason],"NoReason",0,strlen("NoReason"),255);
}
Posts: 1,018
Threads: 320
Joined: Jul 2010
Posts: 11,827
Threads: 33
Joined: Dec 2011
Reputation:
0
The column is 'OffBanReason' and not 'NoReason'.
Posts: 1,018
Threads: 320
Joined: Jul 2010
No you get me wrong I want in offbanreason update text NoReason which mean that player is not banned for example offban. If you know what I mean. I was trying update to OffBanReason to says NoReason.
Posts: 11,827
Threads: 33
Joined: Dec 2011
Reputation:
0
And I'm saying again: the column is 'OffBanReason' like you said in your first post. 'No reason' is the text that will be stored in that column, it is NOT a column itself.
Posts: 1,018
Threads: 320
Joined: Jul 2010
But that text is not storing in the column offbanreason that is the problem offbanreason column is empty but it should be says NoReason. and in mysql log says Unknown NoReason in field list. Thanks
Posts: 11,827
Threads: 33
Joined: Dec 2011
Reputation:
0
It is not stored because the column you wrote is wrong. The column is 'OffBanReason' and the text to be stored is 'NoReason'. You use 'NoReason' as a column which does not exist in your table; therebefore it gives the error and it does not store the data.
Posts: 1,018
Threads: 320
Joined: Jul 2010
Can you maybe give the wright code how it should be like? Thanks
Posts: 11,827
Threads: 33
Joined: Dec 2011
Reputation:
0
Post your code that you execute the query.
Posts: 1,018
Threads: 320
Joined: Jul 2010
pawn Код:
mysql_format(mysql,query,sizeof(query),"UPDATE `users` SET `House` = %d,`OffBanReason` = %s WHERE `ID` = '%d'",
PlayerInfo[playerid][House],PlayerInfo[playerid][OffBanReason],PlayerInfo[playerid][ID]);
mysql_tquery(mysql,query,"","");
This? Thanks