Problem with MySQL R39.
#1

I have a code that checks if an account is banned or not.

pawn Code:
forward CheckAccountBan(sqlpid); // Permet de check un compte ban (Pour un unban, une connexion etc).
public CheckAccountBan(sqlpid)
{
    new query[64];
       
    mysql_format(mysql, query, sizeof(query), "SELECT Locked FROM srp_players_stats WHERE id = %d LIMIT 1", sqlpid);
   
    mysql_tquery(mysql, query, "RetournerID", "");
    return 1;
}



forward RetournerID();
public RetournerID()
{
    if(!cache_num_rows())
    {
        return 0;
    }
    return cache_get_row_int(0, 0); // Retourne si le compte est locked ou non.
}
If i write:

pawn Code:
printf("%d", cache_get_row_int(0, 0));
It returns me 0: Good value.

However if I do:

pawn Code:
printf("%d", CheckAccountBan(playerid));
It returns me 1.

pawn Code:
[21:46:00] [DEBUG] mysql_connect - host: "localhost", user: "root", database: "root", password: "****", port: 3306, autoreconnect: true, pool_size: 2
[21:46:00] [DEBUG] CMySQLHandle::Create - creating new connection..
[21:46:00] [DEBUG] CMySQLHandle::CMySQLHandle - constructor called
[21:46:00] [DEBUG] CMySQLHandle::Create - connection created (id: 1)
[21:46:00] [DEBUG] CMySQLConnection::Connect - establishing connection to database...
[21:46:00] [DEBUG] CMySQLConnection::Connect - connection was successful
[21:46:00] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[21:46:00] [DEBUG] CMySQLConnection::Connect - establishing connection to database...
[21:46:00] [DEBUG] CMySQLConnection::Connect - establishing connection to database...
[21:46:00] [DEBUG] CMySQLConnection::Connect - establishing connection to database...
[21:46:01] [DEBUG] CMySQLConnection::Connect - connection was successful
[21:46:01] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[21:46:01] [DEBUG] CMySQLConnection::Connect - connection was successful
[21:46:01] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[21:46:01] [DEBUG] CMySQLConnection::Connect - connection was successful
[21:46:01] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[21:47:06] [DEBUG] mysql_format - connection: 1, len: 256, format: "SELECT id FROM srp_players_stats WHERE Name = LOWER('%e') LIMIT 1"
[21:47:06] [DEBUG] mysql_tquery - connection: 1, query: "SELECT id FROM srp_players_stats WHERE Name = LOWER('Test_Max')", callback: "ReturnID", format: "(null)"
[21:47:06] [DEBUG] mysql_format - connection: 1, len: 64, format: "SELECT Locked FROM srp_players_stats WHERE id = %d LIMIT 1"
[21:47:06] [DEBUG] mysql_tquery - connection: 1, query: "SELECT Locked FROM srp_players_stats WHERE id = 1 LIMIT 1", callback: "RetournerID", format: "(null)"
[21:47:06] [DEBUG] mysql_format - connection: 1, len: 64, format: "SELECT Locked FROM srp_players_stats WHERE id = %d LIMIT 1"
[21:47:06] [DEBUG] mysql_tquery - connection: 1, query: "SELECT Locked FROM srp_players_stats WHERE id = 1 LIMIT 1", callback: "RetournerID", format: "(null)"
[21:47:06] [DEBUG] CMySQLQuery::Execute[ReturnID] - starting query execution
[21:47:06] [DEBUG] CMySQLQuery::Execute[ReturnID] - query was successfully executed within 1.501 milliseconds
[21:47:06] [DEBUG] CMySQLResult::CMySQLResult() - constructor called
[21:47:06] [DEBUG] CMySQLQuery::Execute[RetournerID] - starting query execution
[21:47:06] [DEBUG] CMySQLQuery::Execute[RetournerID] - query was successfully executed within 1.315 milliseconds
[21:47:06] [DEBUG] CMySQLResult::CMySQLResult() - constructor called
[21:47:06] [DEBUG] CMySQLQuery::Execute[RetournerID] - starting query execution
[21:47:06] [DEBUG] Calling callback "ReturnID"..
[21:47:06] [DEBUG] cache_get_row_count - connection: 1
[21:47:06] [DEBUG] cache_get_row_int - row: 0, field_idx: 0, connection: 1
[21:47:06] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "1"
[21:47:06] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called
[21:47:06] [DEBUG] Calling callback "RetournerID"..
[21:47:06] [DEBUG] CMySQLQuery::Execute[RetournerID] - query was successfully executed within 14.790 milliseconds
[21:47:06] [DEBUG] CMySQLResult::CMySQLResult() - constructor called
[21:47:06] [DEBUG] cache_get_row_int - row: 0, field_idx: 0, connection: 1
[21:47:06] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "0"
[21:47:06] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called
[21:47:06] [DEBUG] Calling callback "RetournerID"..
[21:47:06] [DEBUG] cache_get_row_count - connection: 1
[21:47:06] [DEBUG] cache_get_row_int - row: 0, field_idx: 0, connection: 1
[21:47:06] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "0"
[21:47:06] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called
++
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)