SA-MP Forums Archive
mysql_function_querry Error. - 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_function_querry Error. (/showthread.php?tid=358813)



mysql_function_querry Error. - jtemple042996 - 11.07.2012

Im trying to get the MYSQL plugin to work, and i get the following errors:
Quote:

[15:42:16] >> mysql_query_callback( Connection handle: 0 )
[15:42:16] >> mysql_query_callback() - Invalid connection handle. (You set: 0, Highest connection handle ID is 0).

OnFilterScriptInit():


mysql_debug(1);
connection = mysql_connect("hostname","database","username","pa ss");
if(!mysql_ping())
{
print("[MYSQL]Connection Failed!");
}
else
{
print("[MYSQL]Connection Successful!");
}

OnPlayerConnect:

new string[128];
format(string,sizeof(string),"INSERT INTO test(test) VALUES('HI')");
mysql_function_query(connection,string, false, "OnQueryFinish", "siii");


Re: mysql_function_querry Error. - Jochemd - 11.07.2012

Hmm, I see you forgot some things. mysql_function_query has similar syntaxes as in CallLocalFunction. You didn't even define the values you include. Example:

pawn Код:
mysql_function_query(connection,string, false, "OnQueryFinish", "siii",SomeString,SomeInt,SomeOtherInt,SomeLastInt);
Understood?