Input line too long
#1

Код:
stock SaveStatsForPlayer(playerid)
{
	new query[700];
	mysql_format(mysql, query, sizeof(query), "UPDATE `players` SET `IP`='%s', `Admin`=%d, `VIP`=%d, `Deaths`=%d, `Score`=%d, `Money`=%d, `MissionsPlayed`=%d, `VipTime`=%d, `Warns`=%d, `Cookies`=%d, `Jailed`=%d, `Muted`=%d, `RegisterDate`=%d, `Duty`=%d, `Nopm`=%d WHERE `ID`=%d",\
	IP[playerid], pData[playerid][Admin], pData[playerid][VIP], pData[playerid][Deaths], GetPlayerScore(playerid), pData[playerid][Money], pData[playerid][MissionsPlayed], pData[playerid][VipTime], pData[playerid][Warns], pData[playerid][Cookies], pData[playerid][Jailed], pData[playerid][Muted], pData[playerid][RegisterDate],pData[playerid][Duty], pData[playerid][Nopm], pData[playerid][ID]);
	mysql_tquery(mysql, query, "", "");
}
The error is referred to the query. Thanks
Reply
#2

Make it on two querys
PHP код:
stock SaveStatsForPlayer(playerid)
{
    new 
query[700], query2[500];
    
mysql_format(mysqlquerysizeof(query), "UPDATE `players` SET `IP`='%s', `Admin`=%d, `VIP`=%d, `Deaths`=%d, `Score`=%d, `Money`=%d, `MissionsPlayed`=%d, WHERE `ID`=%d"IP[playerid], pData[playerid][Admin], pData[playerid][VIP], pData[playerid][Deaths], GetPlayerScore(playerid), pData[playerid][Money], pData[playerid][MissionsPlayed]);
mysql_format(mysqlquerysizeof(query), "UPDATE `players` SET  `VipTime`=%d, `Warns`=%d, `Cookies`=%d, `Jailed`=%d, `Muted`=%d, `RegisterDate`=%d, `Duty`=%d, `Nopm`=%d WHERE `ID`=%d"pData[playerid][VipTime], pData[playerid][Warns], pData[playerid][Cookies], pData[playerid][Jailed], pData[playerid][Muted], pData[playerid][RegisterDate],pData[playerid][Duty], pData[playerid][Nopm], pData[playerid][ID]);
    
mysql_tquery(mysqlquery"""");
        
mysql_tquery(mysqlquery2"""");

If you still get the erroe try to take some from the one which you get the error from and put in the other
Reply
#3

Quote:
Originally Posted by nezo2001
Посмотреть сообщение
Make it on two querys
PHP код:
stock SaveStatsForPlayer(playerid)
{
    new 
query[700], query2[500];
    
mysql_format(mysqlquerysizeof(query), "UPDATE `players` SET `IP`='%s', `Admin`=%d, `VIP`=%d, `Deaths`=%d, `Score`=%d, `Money`=%d, `MissionsPlayed`=%d, WHERE `ID`=%d"IP[playerid], pData[playerid][Admin], pData[playerid][VIP], pData[playerid][Deaths], GetPlayerScore(playerid), pData[playerid][Money], pData[playerid][MissionsPlayed]);
mysql_format(mysqlquerysizeof(query), "UPDATE `players` SET  `VipTime`=%d, `Warns`=%d, `Cookies`=%d, `Jailed`=%d, `Muted`=%d, `RegisterDate`=%d, `Duty`=%d, `Nopm`=%d WHERE `ID`=%d"pData[playerid][VipTime], pData[playerid][Warns], pData[playerid][Cookies], pData[playerid][Jailed], pData[playerid][Muted], pData[playerid][RegisterDate],pData[playerid][Duty], pData[playerid][Nopm], pData[playerid][ID]);
    
mysql_tquery(mysqlquery"""");
        
mysql_tquery(mysqlquery2"""");

If you still get the erroe try to take some from the one which you get the error from and put in the other
But you have one mistake,you have query in both formats,second one need to be query2,right?

Like this:

Код:
stock SaveStatsForPlayer(playerid)
{
    new query[700], query2[500];
    mysql_format(mysql, query, sizeof(query), "UPDATE `players` SET `IP`='%s', `Admin`=%d, `VIP`=%d, `Deaths`=%d, `Score`=%d, `Money`=%d, `MissionsPlayed`=%d, WHERE `ID`=%d", IP[playerid], pData[playerid][Admin], pData[playerid][VIP], pData[playerid][Deaths], GetPlayerScore(playerid), pData[playerid][Money], pData[playerid][MissionsPlayed]);
	mysql_format(mysql, query2, sizeof(query2), "UPDATE `players` SET  `VipTime`=%d, `Warns`=%d, `Cookies`=%d, `Jailed`=%d, `Muted`=%d, `RegisterDate`=%d, `Duty`=%d, `Nopm`=%d WHERE `ID`=%d", pData[playerid][VipTime], pData[playerid][Warns], pData[playerid][Cookies], pData[playerid][Jailed], pData[playerid][Muted], pData[playerid][RegisterDate],pData[playerid][Duty], pData[playerid][Nopm], pData[playerid][ID]);
    mysql_tquery(mysql, query, "", "");
    mysql_tquery(mysql, query2, "", "");
}
Reply
#4

Quote:
Originally Posted by TonyVk
Посмотреть сообщение
But you have one mistake,you have query in both formats,second one need to be query2,right?

Like this:

Код:
stock SaveStatsForPlayer(playerid)
{
    new query[700], query2[500];
    mysql_format(mysql, query, sizeof(query), "UPDATE `players` SET `IP`='%s', `Admin`=%d, `VIP`=%d, `Deaths`=%d, `Score`=%d, `Money`=%d, `MissionsPlayed`=%d, WHERE `ID`=%d", IP[playerid], pData[playerid][Admin], pData[playerid][VIP], pData[playerid][Deaths], GetPlayerScore(playerid), pData[playerid][Money], pData[playerid][MissionsPlayed]);
	mysql_format(mysql, query2, sizeof(query2), "UPDATE `players` SET  `VipTime`=%d, `Warns`=%d, `Cookies`=%d, `Jailed`=%d, `Muted`=%d, `RegisterDate`=%d, `Duty`=%d, `Nopm`=%d WHERE `ID`=%d", pData[playerid][VipTime], pData[playerid][Warns], pData[playerid][Cookies], pData[playerid][Jailed], pData[playerid][Muted], pData[playerid][RegisterDate],pData[playerid][Duty], pData[playerid][Nopm], pData[playerid][ID]);
    mysql_tquery(mysql, query, "", "");
    mysql_tquery(mysql, query2, "", "");
}
Yea, Sorry I forgot it
Reply
#5

Updating stuff that hardly, if ever changes is completely pointless. Admin and VIP levels don't change that often and the registration date does not change at all. Update stuff as it changes then you won't need long queries like this.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)