MYSQL 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 Error (
/showthread.php?tid=649661)
MYSQL Error -
solstice_ - 12.02.2018
Hello, i had an old gamemode on my PC and i started to convert it from mysql R39 to MYSQL R41, everything was done and successful but i have a little issue, here it is:
PHP код:
error 025: function heading differs from prototype
Code:
PHP код:
public OnQueryError(errorid, error[], callback[], query[], connectionHandle)
{
foreach (new i : Player)
{
if (PlayerData[i][pAdmin] >= 6 && PlayerData[i][pExecute])
{
PlayerData[i][pExecute] = 0;
Dialog_Show(i, ExecuteQuery, DIALOG_STYLE_INPUT, "Execute Query", "Error: \"%s\"\n\nPlease specify the MySQL query to execute below:", "Execute", "Back", error);
}
}
printf("** [MySQL]: %s", error);
Log_Write("logs/mysql_log.txt", "[%s] %s: %s", ReturnDate(), (callback[0]) ? (callback) : ("n/a"), error);
return 1;
}
PHP код:
public OnQueryError(errorid, error[], callback[], query[], connectionHandle)
^ that is the line
Re: MYSQL Error -
Dayrion - 12.02.2018
Did you search what functions/callback you should update when you change your MySQL version?
It took me 45 seconds to write "mysql samp r41" on ******, open the wiki, look for "OnQueryErro" and find out what's the problem.
Re: MYSQL Error -
solstice_ - 12.02.2018
Quote:
Originally Posted by Dayrion
Did you search what functions/callback you should update when you change your MySQL version?
It took me 45 seconds to write "mysql samp r41" on ******, open the wiki, look for "OnQueryErro" and find out what's the problem. 
|
Yeah i did search the functions and callbacks, when i compiled the gamemode the first time it was R39 it had so many warnings and error because i was using the new version, i changed everything and only that error is left.
Re: MYSQL Error -
AdamsLT - 12.02.2018
This thread has your solution:
https://sampforum.blast.hk/showthread.php?tid=620253
Quote:
Originally Posted by TommyB
Replace OnQueryError with this. Works for me.
Код:
public OnQueryError(errorid, const error[], const callback[], const query[], MySQL:handle)
|
Re: MYSQL Error -
solstice_ - 12.02.2018
Fixed!
Thanks to both Dayrion and AdamsLT.
If anyone else ever faces this problem, here is the solution:
PHP код:
public OnQueryError(errorid, const error[], const callback[], const query[], MySQL:handle)
Re: MYSQL Error -
Dayrion - 13.02.2018
Exactly what I talked about :
https://sampwiki.blast.hk/wiki/MySQL/R40#OnQueryError