SA-MP Forums Archive
So, I have a 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: So, I have a MySQL error. (/showthread.php?tid=585726)



So, I have a MySQL error. - Keyhead - 16.08.2015

pawn Код:
YCMD:checkfamilystrikes(playerid, params[], help){
    if(help){
        SendClientMessage(playerid, X11_WHITE, "Displays family strikes.");
        return 1;
    }
    new fid, sqlfid;
    if(!sscanf(params, "d", fid)){
        if(!IsValidFamily(fid)){
            sqlfid = SQLIDFromFamily(fid);
            format(query, sizeof(query), "SELECT `id`, `owner`, `strikedbyid`, `strikedbyname`, `strikereason` FROM `strikes` WHERE `type` = 1 AND `owner` = %d", sqlfid);
            mysql_function_query(g_mysql_handle, query, true, "onFamilyStrikeCheck", "dd", playerid, fid);
            return 1;
        } else {
            SendClientMessage(playerid, X11_TOMATO_2, "This is not a valid family!");
            return 1;
        }
    } else {
        SendClientMessage(playerid, X11_WHITE, "USAGE:/checkfamilystrikes [FamilyID]");
        return 1;
    }
    return 1;
}
The above code is the command I am using. The command fires and works correctly once, but then when I try it again it just returns "ERROR 1065: Query is empty", Anyone know the solution?


Re: So, I have a MySQL error. - Keyhead - 16.08.2015

Now it has moved to Error 1064. Interesting.

pawn Код:
SQL ERROR: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'S' at line 1