Issue with mysql query that gets cut out
#1

Hello.
My query gets cut out.

code:
PHP код:
forward SetLeader(ffID,target,playerid);
public 
SetLeader(ffID,target,playerid)
{
    new 
string[400];
    
myStrcpy(Player[target][FactionRank],"New Leader");
    new 
query[400];
    
Player[target][Leader] = 1;
    
format(query,sizeof(query),"UPDATE accounts SET FactionRank='New Leader',IsLeader='1' WHERE Username='%s'",Player[target][Faction],Player[target][FactionName],Name(target));
    
mysql_tquery(connection,query,"");
    for(new 
0GetPlayerPoolSize(); <= ji++)
    {
        if(
Player[i][Faction] == ffID)
        {
            
format(string,sizeof(string),"{40FF00}[{BEF781}%s{40FF00}] Administrator {BEF781}%s{40FF00} has set {BEF781}%s{40FF00} as a faction leader.",Player[i][FactionName],RPName(playerid),RPName(target));
            
SendMessage(i,0xFF00FF,string);
        }
    }
    return 
1;

What my mysql log emits:
Код:
[11:38:29] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE accounts SET FactionRank='New Leader',IsLeader='1' WHERE ", callback: "(null)", format: "(null)"
Reply
#2

mysql log does not print the whole format.
If there is something wrong with the query, it will print it in a tag either "[WARNING]" or "[ERROR]".
It's not a problem.
Reply
#3

Quote:
Originally Posted by oMa37
Посмотреть сообщение
mysql log does not print the whole format.
If there is something wrong with the query, it will print it in a tag either "[WARNING]" or "[ERROR]".
It's not a problem.
but it also doesn't update in the database so wtf?
Reply
#4

You have more parameters in format as %s, %i, %d or %f.
PHP код:
format(query,sizeof(query),"UPDATE accounts SET FactionRank='New Leader',IsLeader='1' WHERE Username='%s'",Player[target][Faction],Player[target][FactionName],Name(target)); 
You have one times %s, but you have three parameters.
I hope you know what I mean.
Reply
#5

Quote:
Originally Posted by Mencent
Посмотреть сообщение
You have more parameters in format as %s, %i, %d or %f.
PHP код:
format(query,sizeof(query),"UPDATE accounts SET FactionRank='New Leader',IsLeader='1' WHERE Username='%s'",Player[target][Faction],Player[target][FactionName],Name(target)); 
You have one times %s, but you have three parameters.
I hope you know what I mean.
omfg im so retarded

thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)