Jump to content
  • 0

Eroare baza de date


TheGodfather

Question

Primesc aceasta eroare in logurile serverului:

[20:26:47] ====================================================================
[20:26:47] Error ID: 1064, Eroare: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '10/01/2021 - 20:26:47', '9', '78.97.185.115')' at line 1
[20:26:47] Callback: 
[20:26:47] gQuery: INSERT INTO `logs` (`Userid`, `Text`, `Date`, `Type`, `IP`) VALUES ('144', '(chat) date ca te duc eu unde mere'', '10/01/2021 - 20:26:47', '9', '78.97.185.115')
[20:26:47] ====================================================================

Functie de inserare este aceasta:

function InsertLog(playerid, text[], type) {
    new 
        szQuery[1024], szDate[180], Year, Month, Day, Hour, Minute, Second, ip[180];
        
    getdate(Year, Month, Day);
    gettime(Hour, Minute, Second);
    GetPlayerIp(playerid, ip, sizeof(ip));
    format(szDate, sizeof(szDate), "%02d/%02d/%d - %02d:%02d:%02d", Day, Month, Year, Hour, Minute, Second); 
    mysql_format(SQL, szQuery, sizeof(szQuery), "INSERT INTO `logs` (`Userid`, `Text`, `Date`, `Type`, `IP`) VALUES ('%d', '%s', '%s', '%d', '%s')", PlayerInfo[playerid][pSQLID], text, szDate, type, ip);
    mysql_tquery(SQL, szQuery, "", "");                
    return true;
}

Am cautat prin gamemode acel (chat) si am gasit la onplayertext:

if(PaintType[playerid] != 0) format(string, sizeof(string), "{5088BF}%s [%d kills]: {FFFFFF}%s", GetNameEx(playerid), PKills[playerid], text);
    else if(PlayerInfo[playerid][pColor] != 0) format(string, sizeof(string), "{%s}%s: {FFFFFF}%s", PlayerColors(PlayerInfo[playerid][pColor]), GetNameEx(playerid), text);
    else format(string, sizeof(string), "{%s}%s: {FFFFFF}%s", PlayerInfo[playerid][pHelper] >= 1 || PlayerInfo[playerid][pAdmin] >= 1 && GetPVarInt(playerid, "Cover") != 1 ? ("BA0404") : ("AFAFAF"), GetNameEx(playerid), text);
    if(PaintType[playerid] != 0) {
        SendPaintMessage(PaintType[playerid], -1, string);
        return false;
    }    
    ProxDetector(20.0, playerid, string,COLOR_WHITE);
    format(string, sizeof(string), "(chat) %s", text);
    ChatLog(GetName(playerid), playerid, string);
    
    format(string, sizeof(string), "\"%s\"", text);
    SetPlayerChatBubble(playerid, text, COLOR_CHATBUBBLE, 10.0, 10000);
    return false;

Functia ChatLog este urmatoarea:

function ChatLog(player[], userid, text[]) {
    InsertLog(userid, text, LOG_CHAT);
    return true;
}

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.