Jump to content
  • 0

Problema baza de date


NuamNume

Question

Dialog:DIALOG_REGISTER(playerid, response, listitem, inputtext[])
{
    if(!response)
        return Kick(playerid);
        
    if(strlen(inputtext) < 8 || strlen(inputtext) > 64)
        return Dialog_Show(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Register", "Type your desired password below:\n{AFAFAF}Numarul de caractere trebuie sa fie format din 8 - 64.", "Register", "Cancel");

    format(PlayerInfo[playerid][pName], 24, GetPlayerNameEx(playerid));
    format(PlayerInfo[playerid][pPassword], 128, inputtext);

    gQuery[0] = (EOS);
    mysql_format(SQL, gQuery, sizeof gQuery, "INSERT INTO `users` (Name, Password, RegisterDate, LastLogin) VALUES ('%e', '%e', '%e', '%e')", GetPlayerNameEx(playerid), inputtext, GetDateTime(), GetDateTime());
    
    inline CheckSQLID()
    {
        PlayerInfo[playerid][pSQLID] = cache_insert_id();
        printf("New account: %s (%d).", GetPlayerNameEx(playerid), playerid);
        return true;
    }
    
    mysql_pquery_inline(SQL, gQuery, using inline CheckSQLID, "");
    Dialog_Show(playerid, DIALOG_EMAIL, DIALOG_STYLE_INPUT, "E-mail", "Scrie mai jos adresa ta de e-mail:", "Select", "Cancel");
    return true;
}

Nu am erori, dar dupe ce ma inregistrez si ma duc in baza de date nu se salveaza nimic...

habar nu am de ce

Daca ma poate ajuta cineva intr-o ora de preferat as fii recunoscator..

 

Edit: am pus in alta baza gen acolo la mysql_connect si dupa a mers.. nush ce are

Edited by NuamNume
Link to comment
Share on other sites

24 answers to this question

Recommended Posts

  • 0
Dialog:DIALOG_REGISTER(playerid, response, listitem, inputtext[])
{
    if(!response)
        return Kick(playerid);
        
    if(strlen(inputtext) < 8 || strlen(inputtext) > 64)
        return Dialog_Show(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Register", "Type your desired password below:\n{AFAFAF}Numarul de caractere trebuie sa fie format din 8 - 64.", "Register", "Cancel");

    format(PlayerInfo[playerid][pName], 24, GetPlayerNameEx(playerid));
    format(PlayerInfo[playerid][pPassword], 128, inputtext);

    gQuery[0] = (EOS);
    mysql_format(SQL, gQuery, sizeof gQuery, "INSERT INTO `users` (Name, Password, RegisterDate, LastLogin) VALUES ('%e', '%e', '%e', '%e')", GetPlayerNameEx(playerid), inputtext, GetDateTime(), GetDateTime());
    
    inline CheckSQLID()
    {
        PlayerInfo[playerid][pSQLID] = cache_insert_id();
        printf("New account: %s (%d).", GetPlayerNameEx(playerid), playerid);
    }
    
    mysql_pquery_inline(SQL, gQuery, using inline CheckSQLID, "");
    Dialog_Show(playerid, DIALOG_EMAIL, DIALOG_STYLE_INPUT, "E-mail", "Scrie mai jos adresa ta de e-mail:", "Select", "Cancel");
    return true;
}

Incearca asta.

Link to comment
Share on other sites

  • 0
Dialog:DIALOG_REGISTER(playerid, response, listitem, inputtext[])
{
    if(!response)
        return Kick(playerid);
        
    if(strlen(inputtext) < 8 || strlen(inputtext) > 64)
        return Dialog_Show(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Register", "Type your desired password below:\n{AFAFAF}Numarul de caractere trebuie sa fie format din 8 - 64.", "Register", "Cancel");

    format(PlayerInfo[playerid][pName], 24, GetPlayerNameEx(playerid));
    format(PlayerInfo[playerid][pPassword], 128, inputtext);

    gQuery[0] = (EOS);
    mysql_format(SQL, gQuery, sizeof gQuery, "INSERT INTO `users` (Name, Password, RegisterDate, LastLogin) VALUES ('%e', '%e', '%e', '%e')", GetPlayerNameEx(playerid), inputtext, GetDateTime(), GetDateTime());
    mysql_tquery( SQL, gQuery, "OnPlayerRegister", "i", playerid);
    
    Dialog_Show(playerid, DIALOG_EMAIL, DIALOG_STYLE_INPUT, "E-mail", "Scrie mai jos adresa ta de e-mail:", "Select", "Cancel");
    return true;
}

function OnPlayerRegister(playerid)
{
    PlayerInfo[playerid][pSQLID] = cache_insert_id();
    printf("New account: %s (%d).", GetPlayerNameEx(playerid), playerid);
}

Vezi asa.

Edited by BaFFyJunior
Link to comment
Share on other sites

  • 0

[15:10:31 05/19/20] [ERROR] CMySQLQuery::Execute[FJ37DH3JG_MYSQL_INTERNAL] - (error #1054) Unknown column 'RegisterDate' in 'field list' (Query: "INSERT INTO `users` (Name, Password, RegisterDate, LastLogin) VALUES ('R4uL', 'sadsadasda', '15:10:31 - 19/05/2020', '15:10:31 - 19/05/2020')")

Link to comment
Share on other sites

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.