Mysql problem ERROR 1064
#1

Код:
[18:04:00] >> mysql_query_callback( Connection handle: 1 )
[18:04:00] Passing query SELECT * FROM `usuarios` WHERE Nombre='[NEO]PewDiePie' | ii
[18:04:00] ProcessQueryThread(OnQueryFinish) - Query was successful. (SELECT * FROM `usuarios` WHERE Nombre='[NEO]PewDiePie')
[18:04:00] ProcessQueryThread(OnQueryFinish) - Data caching enabled.
[18:04:00] CMySQLHandler::StoreResult() - Result was stored.
[18:04:00] CMySQLHandler::FreeResult() - Result was successfully free'd.
[18:04:00] CMySQLHandler::ProcessQueryThread() - Data is getting passed to ->ProcessTick()
[18:04:00] OnQueryFinish(ii) - Threaded function called.
[18:04:00] >> cache_get_data( Connection handle: 1 )
[18:04:00] ProcessTick() - The cache has been cleared.
[18:04:08] >> mysql_query_callback( Connection handle: 1 )
[18:04:08] Passing query INSERT INTO `usuarios` (Nombre, Pass) VALUES ([NEO]PewDiePie,*******) | ii
[18:04:08] CMySQLHandler::ProcessQueryThread() - Error will be triggered to OnQueryError()
[18:04:08] OnQueryError() - Called.
[18:04:10] >> mysql_query_callback( Connection handle: 1 )
[18:04:10] Passing query SELECT * FROM `usuarios` WHERE `Nombre` = '[NEO]PewDiePie' | ii
[18:04:10] ProcessQueryThread(OnQueryFinish) - Query was successful. (SELECT * FROM `usuarios` WHERE `Nombre` = '[NEO]PiewDiePie')
[18:04:10] ProcessQueryThread(OnQueryFinish) - Data caching enabled.
[18:04:10] CMySQLHandler::StoreResult() - Result was stored.
[18:04:10] CMySQLHandler::FreeResult() - Result was successfully free'd.
[18:04:10] CMySQLHandler::ProcessQueryThread() - Data is getting passed to ->ProcessTick()
[18:04:10] OnQueryFinish(ii) - Threaded function called.
[18:04:10] >> cache_get_data( Connection handle
[18:04:10] ProcessTick() - The cache has been cleared.
: 1 )

Код:
[18:04:00] [join] [NEO]PewDiePie has joined the server (1:127.0.0.1)
[18:04:08] [ERROR] ID: 1064 - Error: 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 '[NEO]PiewDiePie,*******)' at line 1 - Callback - OnQueryFinish - Query: INSERT INTO `usuarios` (Nombre, Pass) VALUES ([NEO]PewDiePie,********)
This the line where it starts :C


pawn Код:
{
        new string[256];
        new pName[24], Query[256]; GetPlayerName(playerid, pName, 24);
        switch(dialogid)
        {
            case LOGIN:
            {
                if(!response)
                {
                    Kick(playerid);
                }
                if(strcmp(pInfo[playerid][Pass], inputtext, true, 128) == 0)
                {
                    format(Query, sizeof(Query), "SELECT * FROM `usuarios` WHERE `Nombre` = '%s'", pName);
                    mysql_function_query(Conecction, Query, true, "OnQueryFinish", "ii", 1, playerid);
                    SetPlayerScore(playerid, pInfo[playerid][Scores]);
                }
                else
                {
                    SendClientMessage(playerid, -1, "CONTRASEСA INCORRECTA");
                    Kick(playerid);
                }
            }
            case REGISTRO:
            {
                if(!response)
                {
                    SendClientMessage(playerid, -1, "Kicked");
                    Kick(playerid);
                }
                if(response)
                {
                if(!strlen(inputtext))
                {
                    Kick(playerid);
                }
                new password[32];
                format(password, sizeof(password), "%s", inputtext); pInfo[playerid][Pass] = password;
                format(Query, sizeof(Query), "INSERT INTO `usuarios` (Nombre, Pass) VALUES (%s,%s)",pName, pInfo[playerid][Pass]);
                mysql_function_query(Conecction, Query, true, "OnQueryFinish", "ii", 0, playerid);
                format(string, sizeof(string), "Has registrado el personaje %s en nuestro servidor.\n\nAhora inicia sesiуn", pName);
                ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_PASSWORD,"Iniciar sesiуn",string,"Enviar","Salir");
            }
        }
    }
    }

THIS IS THE ERROR
Код:
[18:04:00] [join] [NEO]PewDiePie has joined the server (1:127.0.0.1)
[18:04:08] [ERROR] ID: 1064 - Error: 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 '[NEO]PiewDiePie,*******)' at line 1 - Callback - OnQueryFinish - Query: INSERT INTO `usuarios` (Nombre, Pass) VALUES ([NEO]PewDiePie,********)
where did i anything bad?
Reply
#2

you had syntax error, this should do

pawn Код:
{
        new string[256];
        new pName[24], Query[256]; GetPlayerName(playerid, pName, 24);
        switch(dialogid)
        {
            case LOGIN:
            {
                if(!response)
                {
                    Kick(playerid);
                }
                if(strcmp(pInfo[playerid][Pass], inputtext, true, 128) == 0)
                {
                    format(Query, sizeof(Query), "SELECT * FROM `usuarios` WHERE `Nombre` = '%s'", pName);
                    mysql_function_query(Conecction, Query, true, "OnQueryFinish", "ii", 1, playerid);
                    SetPlayerScore(playerid, pInfo[playerid][Scores]);
                }
                else
                {
                    SendClientMessage(playerid, -1, "CONTRASEСA INCORRECTA");
                    Kick(playerid);
                }
            }
            case REGISTRO:
            {
                if(!response)
                {
                    SendClientMessage(playerid, -1, "Kicked");
                    Kick(playerid);
                }
                if(response)
                {
                if(!strlen(inputtext))
                {
                    Kick(playerid);
                }
                new password[32];
                format(password, sizeof(password), "%s", inputtext); pInfo[playerid][Pass] = password;
                format(Query, sizeof(Query), "INSERT INTO `usuarios` (Nombre, Pass) VALUES ('%s','%s')",pName, pInfo[playerid][Pass]);
                mysql_function_query(Conecction, Query, true, "OnQueryFinish", "ii", 0, playerid);
                format(string, sizeof(string), "Has registrado el personaje %s en nuestro servidor.\n\nAhora inicia sesiуn", pName);
                ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_PASSWORD,"Iniciar sesiуn",string,"Enviar","Salir");
            }
        }
    }
    }
Reply
#3

YEAH ! I LOVE YOU MAN (heart) ! yes YES YES YSE є
Reply
#4

hehe, no probs man
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)