SA-MP Forums Archive
invalid connection handle. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: invalid connection handle. (/showthread.php?tid=448174)



invalid connection handle. - NeroX98 - 03.07.2013

Hi guys.

I have a very annoying problem with the newest mysql (R7).
The problem is that the MYSQL connects to the database succsessfully but doesn't want to select, udate, insert etc.

Here is my code:
pawn Код:
forward ProverkaAkaunt(account[]);

stock CheckAccountExists(account[])
{
    new query[164];
    format(query, sizeof(query), "SELECT * FROM Igraci WHERE pProfil = '%s'", account);
    printf(query);
// THIS ->  mysql_function_query(connectionHandle, query, true, "ProverkaAkaunt", "%s", account);
    return 1;
}

public ProverkaAkaunt(account[])
{
    print("test"); // DOESN'T PRINT !!!
    new rows, fields;
    cache_get_data(rows, fields);
    if(!rows)
    {
        print(!"not registered account on this server!");
    }
    else
    {
        printf("Account registered");
    }
}
The commented line is causing the mysql error:
Код:
mysql_function_query(connectionHandle, query, true, "ProverkaAkaunt", "%s", account);
The error in mysql_log:
Код:
[08:21:08] [ERROR] "mysql_tquery" - invalid connection handle. (ID = 0).
Here's another interesting thing The ProverkaAkaunt callback it's not calling ! I've noticed that by putting:
pawn Код:
print("test");
But it doesn't print !

So what to do ?