Jump to content
  • 0

Salvare LastLogin


NuamNume

Question

Nu stiu ce are...

Baza de date: 

  ID Name Password Email RegisterDate LastLogin
        4 R4uL parola123 none 0000-00-00 0000-00-00

 

ce are fratilor? cod:

    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());
    mysql_pquery(SQL, gQuery, "", ""); // se salveaza (cred) la register

am si functia asta: stock GetDateTime()
{
    new string[64], hour, minute, second, year, month, day;
    
    gettime(hour, minute, second);
    getdate(year, month, day);
    
    format(string, sizeof string, "%02d:%02d:%02d - %02d/%02d/%0d", hour, minute, second, day, month, year);
    SendClientMessageToAll(-1, string);
    return string;
}

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0
stock GetDateTime()
{
    new zStr[ 30 ], liDate[ 6 ];

    getdate( liDate[ 0 ], liDate[ 1 ], liDate[ 2 ] );
    gettime( liDate[ 3 ], liDate[ 4 ], liDate[ 5 ] );

    format( zStr, 30, "%02d:%02d %02d/%02d/%d", liDate[ 3 ], liDate[ 4 ], liDate[ 2 ], liDate[ 1 ], liDate[ 0 ] );
    return zStr;
}
 mysql_format(SQL, gQuery, sizeof gQuery, "INSERT INTO `users` (Name, Password, RegisterDate, LastLogin) VALUES ('%e', '%e', '%e', '%e')", GetPlayerNameEx(playerid), inputtext, GetDateTime(), GetDateTime());

 

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.