[HELP] Account Mysql
#1

I tried to make the users to use mysql, but when I do my new account, I always give the same thing as in the picture below:

Picture
Reply
#2

Care to provide some insight into your code?

What version of MySQL are you using?
Reply
#3

MySQL plugin R6.
Reply
#4

y u no update to R39?

show us the code you're using.

R6 version (i havent used it in a long time) example:

pawn Код:
format(query,sizeof(query),"SELECT * FROM `userdata` WHERE `player` = '%s'",PlayerName);
mysql_query(query);

if(mysql_num_rows(query))//registered
{
    //code
}
else //not registered
{
    //code
}
Checks if they're in the database.
Reply
#5

pawn Код:
public MySQLCreateAccount(newplayersname[], newpassword[], playerid)
{
    new query[300];
    new sqlplyname[64];
    //new sqlpassword[64];
    new parolacript[129];

   mysql_real_escape_string(newplayersname, sqlplyname);
    //mysql_real_escape_string(newpassword, sqlpassword);
    WP_Hash(parolacript, sizeof(parolacript), newpassword);

    format(query, sizeof(query), "INSERT INTO players (Name, Password) VALUES ('%s', '%s')", sqlplyname, parolacript);
    mysql_query(query);
    Registerr[playerid] = 2;
    new string[256];
   format(string, sizeof(string), "%s s-a inregistrat pe server!",newplayersname);
                ABroadCast(COLOR_LIGHTRED,string,1);
             
                SBroadCast(COLOR_LIGHTRED, string);
    print("[MySQL]: Un nou cont a fost creat in baza de date!(..)01");
    mysql_free_result();
    print("[MySQL]: Un nou cont a fost creat in baza de date!(..)02");
    //mysql_free_result();
    new newplayersid = MySQLCheckAccount(newplayersname);
    if (newplayersid != 0)
    {
        return newplayersid;
    }
    return 0;
}

How can create the data base .sql?
Reply
#6

Are you checking if the account exists when they connect?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)