MYSQL - login with threded query
#1

I am building a new gamemode and i'm working at the login system .
The problem is that every time I login the server the server shows me the register dialog even if I have an account already .
I'm using the lastest MySQL- plugin (r39-5).

PHP код:
[19:29:40] [DEBUGmysql_connect host"127.0.0.1"user"root"database"newgm"password"****"port3306autoreconnecttruepool_size2
[19:29:40] [DEBUGCMySQLHandle::Create creating new connection..
[
19:29:40] [WARNINGCMySQLHandle::Create connection already exists
[19:29:40] [DEBUGCMySQLConnection::Connect establishing connection to database...
[
19:29:40] [DEBUGCMySQLConnection::Connect connection was successful
[19:29:40] [DEBUGCMySQLConnection::Connect auto-reconnect has been enabled
[19:29:40] [DEBUGmysql_errno connection1
[19:29:40] [DEBUGCMySQLConnection::Connect establishing connection to database...
[
19:29:40] [DEBUGCMySQLConnection::Connect connection was successful
[19:29:40] [DEBUGCMySQLConnection::Connect auto-reconnect has been enabled
[19:29:40] [DEBUGCMySQLConnection::Connect establishing connection to database...
[
19:29:40] [DEBUGCMySQLConnection::Connect connection was successful
[19:29:40] [DEBUGCMySQLConnection::Connect auto-reconnect has been enabled
[19:29:40] [DEBUGCMySQLConnection::Connect establishing connection to database...
[
19:29:40] [DEBUGCMySQLConnection::Connect connection was successful
[19:29:40] [DEBUGCMySQLConnection::Connect auto-reconnect has been enabled
[19:29:40] [DEBUGmysql_tquery connection1query"SELECT `Password`, `ID` FROM `useri` WHERE `nume` = 'e' LIMIT 1"callback"AccCheck"format"i"
[19:29:40] [DEBUGCMySQLQuery::Execute[AccCheck] - starting query execution
[19:29:40] [DEBUGCMySQLQuery::Execute[AccCheck] - query was successfully executed within 0.462 milliseconds
[19:29:40] [DEBUGCMySQLResult::CMySQLResult() - constructor called
[19:29:40] [DEBUGCalling callback "AccCheck"..
[
19:29:40] [DEBUGcache_get_data connection1
[19:29:40] [DEBUGCMySQLResult::~CMySQLResult() - deconstructor called 
MySQL- log

PHP код:
forward AccCheck(playerid);
public 
AccCheck(playerid)
{
    new 
fields,rows;
    
cache_get_data(rows fieldssql);
    if(
rows)
    {
        
cache_get_field_content(0"Password"PlayerInfo[playerid][pPass], sql129); 
        
PlayerInfo[playerid][pID] = cache_get_field_content_int(0"ID");
        new 
loginstring[128];
        
format(loginstring,sizeof(loginstring),"Bine ai revenit , Introdu parola pentru a juca. ");
        
ShowPlayerDialog(playerid,LoginDialog,DIALOG_STYLE_PASSWORD,"Login",loginstring,"Login","Quit");
    }
    else
    {
        
ShowPlayerDialog(playerid,RegisterDialog,DIALOG_STYLE_PASSWORD,"Register","Bine ai venit pe serverul nostru ! Introdu o parola pentru a te inregistra:","Register","Quit");
    }
    return 
1;

PHP код:
public OnPlayerConnect(playerid)
{
    new 
query[128];
    
format(query,sizeof(query),"SELECT `Password`, `ID` FROM `useri` WHERE `nume` = '%e' LIMIT 1",GetName(playerid));
     
mysql_tquery(sql,query,"AccCheck","i",playerid);
    
gPlayerLogged[playerid] = 0;
    return 
1;

Reply


Messages In This Thread
MYSQL - login with threded query - by Ax3l123 - 03.08.2016, 16:42
Re: MYSQL - login with threded query - by AndySedeyn - 03.08.2016, 16:44
Re: MYSQL - login with threded query - by Ax3l123 - 03.08.2016, 17:26

Forum Jump:


Users browsing this thread: 1 Guest(s)