SA-MP Forums Archive
Updating mysql please help me out! - 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: Updating mysql please help me out! (/showthread.php?tid=534917)



Updating mysql please help me out! - Seifspeed - 01.09.2014

Hello guys,
I am trying to update my mysql from r4 to r39
i updated the include and the .dll
but i keep on geting erorr

Код:
error 035: argument type mismatch (argument 1)
What should i chang here to fix this?

Код:
format(sql, sizeof(sql), "UPDATE `samp_trunks` SET `TS1`=1 WHERE PlayerID='%d'", PlayerInfo[playerid][pDBID]); mysql_query(sql, THREAD_UPDATE, playerid);
Please help me out.


Re: Updating mysql please help me out! - IceCube! - 01.09.2014

How have you defined sql?

Like this:

pawn Код:
new sql[128]; //128 is an example, could be any value preferably the size of your string
or

pawn Код:
new sql;
The first example is how you should have defined it. The 2nd is how (I think) you've defined it.

If you've defined it properly post more code, it's idiocy thinking we can work with the error line alone.


Re : Updating mysql please help me out! - Seifspeed - 01.09.2014

I already had it like that.

new sql[128];


Re : Updating mysql please help me out! - Seifspeed - 01.09.2014

Anyone?


Re : Updating mysql please help me out! - Seifspeed - 01.09.2014

Please!


Re: Updating mysql please help me out! - DobbysGamertag - 01.09.2014

You're doing it completly wrong (well not entirely) you're trying to thread the queries right?

pawn Код:
new Database = 1;


//OnGameModeInit()

public OnGameModeInit()
{
    Database = mysql_connect(...);
    return 1;
}
new sql[130];
format(sql, sizeof(sql), "UPDATE `samp_trunks` SET `TS1`=1 WHERE PlayerID='%d'", PlayerInfo[playerid][pDBID]);
mysql_tquery(Database,sql,"OnTrunkUpdated","i",playerid);

forward OnTrunkUpdated(playerid);
public OnTrunkUpdated(playerid)
{
    //do whatever here.
    return 1;
}


//Or do it this way:


new sql[130];
format(sql, sizeof(sql), "UPDATE `samp_trunks` SET `TS1`=1 WHERE PlayerID='%d'", PlayerInfo[playerid][pDBID]);
mysql_tquery(Database,sql, "","");