(error #1064)
#1

Код HTML:
[ERROR] mysql_format - destination size is too small
 [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 '' at line 1
[ERROR] mysql_format - destination size is too small
[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 '' at line 1
From what is this error

PHP код:
    if(dialogid == DIALOG_FPUNINVITE)
    {
        if(
response)
        {
            new 
string1[300],result[30],name[30],rank,ftime,reason[128],idd;
            
format(string1sizeof(string1), "SELECT * FROM `users` WHERE `id`='%d'",Selected2[playerid]);
            new 
Cachemembresult mysql_query(SQL,string1);
            for(new 
icache_get_row_count (); != j; ++i)
            {
                
cache_get_field_content(i"name"result); format(name30result);
                
ftime cache_get_field_content_int(i"FactionTime");
                
rank cache_get_field_content_int(i"Rank");
                
idd cache_get_field_content_int(i"id");
            }
            
cache_delete(membresult);
            
mysql_real_escape_string(inputtextreason);
            new 
string2[500],query[500];
            
format(string2sizeof(string2), "%s was uninvited by %s from faction %s (rank %d) after %d days, with FP. Reason: %s."name,PlayerInfo[playerid][pNormalName],DynamicFactions[PlayerInfo[playerid][pMember]][fName],rank,ftime,reason);
            
mysql_format(SQLquerysizeof(query), "INSERT INTO faction_logs (`text`,`player`,`leader`) VALUES ('%s','%d','%d')"string2iddPlayerInfo[playerid][pSQLID]);
            
mysql_tquery(SQL,query,"","");
            
mysql_format(SQL,string1,sizeof(string1),"UPDATE users SET `Team`='3',`Member`='0',`Leader`='0',`Rank`='0',`Model`='250',`FPunish`='20',`FWarn`='0',`FactionTime`='0',`Runners`='0',`Arrestss`='0',`Tickets`='0',`WKills`='0',`WDeaths`='0',`MoneyD`='0',`MDeposit`='0',`DDeposit`='0',`Orders`='0',`PHeals`='0',`LGiven`='0',`MUsed`='0',`News`='0',`Lives`='0',`DConfiscate`='0',`LConfiscate`='0',`Contracts`='0' WHERE `id`='%d'",Selected2[playerid]);
            
mysql_tquery(SQL,string1,"","");
            foreach(
Playeri)
            {
                if(
PlayerInfo[i][pSQLID] == Selected2[playerid])
                {
                    
gTeam[i] = 3;
                    
PlayerInfo[i][pTeam] = 3;
                    
PlayerInfo[i][pMember] = 0;
                    
PlayerInfo[i][pRank] = 0;
                      
PlayerInfo[i][pLeader] = 0;
                    
PlayerInfo[i][pFACWarns] = 0;
                    
PlayerInfo[i][pFpunish] = 20;
                    
PlayerInfo[i][pFactionTime] = 0;
                    
PlayerInfo[i][pModel] = 250;
                    
SetPlayerArmourEx(i0);
                    
tazer[i] = 0;
                    
OnDuty[i] = 0;
                    
SetPlayerSkin(i,PlayerInfo[i][pModel]);
                    
SpawnPlayer(i);
                }
            }
            
format(string1sizeof(string1),"%s was uninvited by %s from faction %s (rank %d) after %d days, with 20 FP. Reason: %s",name,PlayerInfo[playerid][pNormalName],DynamicFactions[PlayerInfo[playerid][pMember]][fName],rank,ftime,reason);
            
Factionlog(PlayerInfo[playerid][pMember],idd,PlayerInfo[playerid][pSQLID],string1);
            
SendFamilyMessage(PlayerInfo[playerid][pMember], COLOR_GENANNOUNCEstring1);
        }
        return 
1;
    }
    if(
dialogid == DIALOG_NOUNINVITE)
    {
        if(
response)
        {
            new 
string1[300],result[30],name[30],rank,ftime,reason[128],idd;
            
format(string1sizeof(string1), "SELECT * FROM `users` WHERE `id`='%d'",Selected2[playerid]);
            new 
Cachemembresult mysql_query(SQL,string1);
            for(new 
icache_get_row_count (); != j; ++i)
            {
                
cache_get_field_content(i"name"result); format(name30result);
                
ftime cache_get_field_content_int(i"FactionTime");
                
rank cache_get_field_content_int(i"Rank");
                
idd cache_get_field_content_int(i"id");
            }
            
cache_delete(membresult);
            
mysql_real_escape_string(inputtextreason);
            new 
string2[500],query[500];
            
format(string2sizeof(string2), "%s was uninvited by %s from faction %s (rank %d) after %d days, without FP. Reason: %s."name,PlayerInfo[playerid][pNormalName],DynamicFactions[PlayerInfo[playerid][pMember]][fName],rank,ftime,reason);
            
mysql_format(SQLquerysizeof(query), "INSERT INTO faction_logs (`text`,`player`,`leader`) VALUES ('%s','%d','%d')"string2iddPlayerInfo[playerid][pSQLID]);
            
mysql_tquery(SQL,query,"","");
            
mysql_format(SQL,string1,sizeof(string1),"UPDATE users SET `Team`='3',`Member`='0',`Leader`='0',`Rank`='0',`Model`='250',`FPunish`='0',`FWarn`='0',`FactionTime`='0',`Runners`='0',`Arrestss`='0',`Tickets`='0',`WKills`='0',`WDeaths`='0',`MoneyD`='0',`MDeposit`='0',`DDeposit`='0',`Orders`='0',`PHeals`='0',`LGiven`='0',`MUsed`='0',`News`='0',`Lives`='0',`DConfiscate`='0',`LConfiscate`='0',`Contracts`='0' WHERE `id`='%d'",Selected2[playerid]);
            
mysql_tquery(SQL,string1,"","");
            foreach(
Playeri)
            {
                if(
PlayerInfo[i][pSQLID] == Selected2[playerid])
                {
                    
gTeam[i] = 3;
                    
PlayerInfo[i][pTeam] = 3;
                    
PlayerInfo[i][pMember] = 0;
                    
PlayerInfo[i][pRank] = 0;
                      
PlayerInfo[i][pLeader] = 0;
                    
PlayerInfo[i][pFACWarns] = 0;
                    
PlayerInfo[i][pFpunish] = 0;
                    
PlayerInfo[i][pFactionTime] = 0;
                    
PlayerInfo[i][pModel] = 250;
                    
SetPlayerArmourEx(i0);
                    
tazer[i] = 0;
                    
OnDuty[i] = 0;
                    
SetPlayerSkin(i,PlayerInfo[i][pModel]);
                    
SpawnPlayer(i);
                }
            }
            
format(string1sizeof(string1),"%s was uninvited by %s from faction %s (rank %d) after %d days, without FP. Reason: %s",name,PlayerInfo[playerid][pNormalName],DynamicFactions[PlayerInfo[playerid][pMember]][fName],rank,ftime,reason);
            
Factionlog(PlayerInfo[playerid][pMember],idd,PlayerInfo[playerid][pSQLID],string1);
            
SendFamilyMessage(PlayerInfo[playerid][pMember], COLOR_GENANNOUNCEstring1);
        }
        return 
1;
    } 
Reply
#2

Hello.
Remove this
PHP код:
query[500]; 
and insert
PHP код:
query [3000]; 
Reply
#3

Quote:
Originally Posted by Pearson
Посмотреть сообщение
Hello.
Remove this
PHP код:
query[500]; 
and insert
PHP код:
query [3000]; 
3000? What?

pawn Код:
new string[1024];
If that doesnt work, increase it by 100 until you find what works. Dont go nuts on string sizes and avoid huge queries like these. Save/Load stuff more frequently but in smaller queries.
Reply
#4

Quote:
Originally Posted by TwinkiDaBoss
Посмотреть сообщение
3000? What?

pawn Код:
new string[1024];
If that doesnt work, increase it by 100 until you find what works. Dont go nuts on string sizes and avoid huge queries like these. Save/Load stuff more frequently but in smaller queries.
XD. idk =D
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)