SA-MP Forums Archive
MySQL issues - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MySQL issues (/showthread.php?tid=640084)



MySQL issues - aoky - 27.08.2017

It was saving before, but now I'm quiet unsure as to why this is happening.
PHP код:
forward SaveAccountStats(playerid);
public 
SaveAccountStats(playerid)
{
    if(
Logged[playerid] == 1)
    {
        new 
query[1280];
        
mysql_format(mysqlquerysizeof(query), "UPDATE `users` SET `Money`=%d, `Admin`=%d, `Vip`=%d, `Kills`=%d, `Deaths`=%d, `Score`=%d, `Rank`=%d, `Banned`=%d, `Warns`=%d, ",\
        
PlayerInfo[playerid][pMoney], PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pVip], PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths], PlayerInfo[playerid][pScore], PlayerInfo[playerid][pRank], PlayerInfo[playerid][pBanned],\
        
PlayerInfo[playerid][pWarns]);
        
mysql_format(mysqlquerysizeof(query), "%s`VW`=%d, `Interior`=%d, `Min`=%d, `Hours`=%d, `PM`=%d, `Color`=%d, `Turfs`=%d, `Clan`=%d, ",\
         
queryPlayerInfo[playerid][pVW], PlayerInfo[playerid][pInt], PlayerInfo[playerid][pMin], PlayerInfo[playerid][pHour], PlayerInfo[playerid][pPM], PlayerInfo[playerid][pColor], PlayerInfo[playerid][pTurfs], PlayerInfo[playerid][pClan]);
        
mysql_format(mysqlquerysizeof(query), "%s`ClRank`=%d, `ClLeader`=%d, `Invited`=%d, `Inviting`=%d  WHERE `ID`=%d",\
        
queryPlayerInfo[playerid][pClRank], PlayerInfo[playerid][pClLeader], PlayerInfo[playerid][pInvited], PlayerInfo[playerid][pInviting], PlayerInfo[playerid][pID]);
        
mysql_tquery(mysqlquery"""");
        return 
1;
    }
    return 
0;

MySQL error:
PHP код:
[DEBUGCMySQLQuery::Execute[] - no callback specifiedskipping result saving



Re: MySQL issues - Vince - 27.08.2017

That's a debug message, not an error message. It doesn't indicate abnormal behavior.


Re: MySQL issues - aoky - 27.08.2017

I see, either way it's not saving the players stats because it's skipping the save.


Re: MySQL issues - raydx - 28.08.2017

I've always used it like this in R41, but i don't know which version you are using. Maybe thats why it is looking for callback.

mysql_tquery(mysql, query, "", "");

>

mysql_tquery(mysql, query);


Re: MySQL issues - Vince - 28.08.2017

Quote:
Originally Posted by aoky
Посмотреть сообщение
I see, either way it's not saving the players stats because it's skipping the save.
"Skipping result saving" just means that it doesn't generate a cache (for use with cache_ functions). Have you actually checked the database?


Re: MySQL issues - aoky - 29.08.2017

Quote:
Originally Posted by Vince
Посмотреть сообщение
"Skipping result saving" just means that it doesn't generate a cache (for use with cache_ functions). Have you actually checked the database?
The database is fine, sorry for the late reply but I'm positive this isn't working.


Re: MySQL issues - Dayrion - 29.08.2017

You should use strcat instead of mysql_format to 'create' your query and at the end, use mysql_format to format your query.


Re: MySQL issues - thegamer355 - 29.08.2017

Formatting the query will make it have that information, the 3rd time you do this, all info before has been gone, that's why it doesn't save.

Do as Dayrion said, or make 3 smaller queries and execute them 1 by 1


Re: MySQL issues - aoky - 01.09.2017

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
You should use strcat instead of mysql_format to 'create' your query and at the end, use mysql_format to format your query.
It worked before, I'm not sure why it won't save the players stats.

PHP код:
no callback specifiedskipping result saving 
Clearly this is an issue, but I don't know why.


Re: MySQL issues - Spmn - 01.09.2017

Quote:
Originally Posted by aoky
Посмотреть сообщение
It worked before, I'm not sure why it won't save the players stats.

PHP код:
no callback specifiedskipping result saving 
Clearly this is an issue, but I don't know why.
That is NOT an issue, as you were told before.

Eg: if you do:
Код:
mysql_tquery(mysql, query, "RandomPublic", ""); 
// ...
forward RandomPublic();
public RandomPublic() { }
That debug message will be supressed.