SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 12/02/2018, 11:33 PM   #1
willbedie
Gangsta
 
willbedie's Avatar
 
Join Date: Feb 2016
Location: Albania
Posts: 525
Reputation: 43
Default MYSQL Error

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 Code:
error 025: function heading differs from prototype 

Code:

PHP Code:
public OnQueryError(erroriderror[], callback[], query[], connectionHandle)
{
    foreach (new 
Player)
    {
        if (
PlayerData[i][pAdmin] >= && PlayerData[i][pExecute])
        {
            
PlayerData[i][pExecute] = 0;
            
Dialog_Show(iExecuteQueryDIALOG_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 Code:
public OnQueryError(erroriderror[], callback[], query[], connectionHandle
^ that is the line
__________________


willbedie is offline   Reply With Quote
Old 12/02/2018, 11:38 PM   #2
Dayrion
High-roller
 
Dayrion's Avatar
 
Join Date: Jan 2016
Location: France
Posts: 1,927
Reputation: 256
Default Re: MYSQL Error

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.
__________________
actor_plus - v5.0.2
I'm a goner, somebody catch my breath,
I'm a goner, somebody catch my breath
Dayrion is offline   Reply With Quote
Old 12/02/2018, 11:39 PM   #3
willbedie
Gangsta
 
willbedie's Avatar
 
Join Date: Feb 2016
Location: Albania
Posts: 525
Reputation: 43
Default Re: MYSQL Error

Quote:
Originally Posted by Dayrion View Post
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.
__________________


willbedie is offline   Reply With Quote
Old 12/02/2018, 11:44 PM   #4
AdamsLT
Big Clucker
 
AdamsLT's Avatar
 
Join Date: Oct 2011
Location: Lithuania
Posts: 115
Reputation: 31
Default Re: MYSQL Error

This thread has your solution: http://forum.sa-mp.com/showthread.php?t=620253

Quote:
Originally Posted by TommyB View Post
Replace OnQueryError with this. Works for me.

Code:
public OnQueryError(errorid, const error[], const callback[], const query[], MySQL:handle)
AdamsLT is offline   Reply With Quote
Old 12/02/2018, 11:46 PM   #5
willbedie
Gangsta
 
willbedie's Avatar
 
Join Date: Feb 2016
Location: Albania
Posts: 525
Reputation: 43
Default Re: MYSQL Error

Fixed!

Thanks to both Dayrion and AdamsLT.

If anyone else ever faces this problem, here is the solution:

PHP Code:
public OnQueryError(errorid, const error[], const callback[], const query[], MySQL:handle
__________________


willbedie is offline   Reply With Quote
Old 13/02/2018, 12:51 AM   #6
Dayrion
High-roller
 
Dayrion's Avatar
 
Join Date: Jan 2016
Location: France
Posts: 1,927
Reputation: 256
Default Re: MYSQL Error

Exactly what I talked about : http://wiki.sa-mp.com/wiki/MySQL/R40#OnQueryError
__________________
actor_plus - v5.0.2
I'm a goner, somebody catch my breath,
I'm a goner, somebody catch my breath
Dayrion is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL] Error (0): Failed to exeute query. You have an error in your SQL syntax; check the manual that corresponds to you lulo356 Scripting Help 3 24/07/2015 05:58 AM
(error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for t SandKing94 Scripting Help 3 22/05/2015 08:53 AM
[MYSQL ERROR ] Access denied for user 'your username here'@'localhost' (using password: YES) (error ID: 1045). SpikY_ Scripting Help 3 07/11/2014 04:09 PM
MySQL Plugin r39-2 Error: Can't connect to local MySQL server through socket Emre__ Scripting Help 10 30/07/2014 08:26 AM
Mysql queriesYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for th audriuxxx Scripting Help 4 11/04/2014 06:42 PM


All times are GMT. The time now is 07:34 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.