[HELP] noreason column
#1

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);
    }
Reply
#2

anyone? thanks
Reply
#3

The column is 'OffBanReason' and not 'NoReason'.
Reply
#4

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.
Reply
#5

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.
Reply
#6

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
Reply
#7

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.
Reply
#8

Can you maybe give the wright code how it should be like? Thanks
Reply
#9

Post your code that you execute the query.
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)