Error LOAD mysql
#1

Why is giving these errors that are similar when you press the players and when you press the houses?

When the player Connecta that carries it:
pawn Код:
[ERROR] "mysql_query" - invalid connection handle (id: 0)
When I open the gamemode that tries to load the houses:
pawn Код:
[20:48:41] [WARNING] CMySQLHandle::Create - connection already exists
[20:48:41] [ERROR] "mysql_query" - invalid connection handle (id: 0)
[20:48:41] [WARNING] cache_get_data - no active cache
[20:48:41] [ERROR] "mysql_query" - invalid connection handle (id: 0)
[20:48:41] [WARNING] cache_get_data - no active cache
[20:48:41] [ERROR] "mysql_query" - invalid connection handle (id: 0)
[20:48:41] [WARNING] cache_get_data - no active cache
[20:48:41] [ERROR] "mysql_query" - invalid connection handle (id: 0)
[20:48:41] [WARNING] cache_get_data - no active cache
[20:48:41] [ERROR] "mysql_query" - invalid connection handle (id: 0)
[20:48:41] [WARNING] cache_get_data - no active cache
[20:48:41] [ERROR] "mysql_query" - invalid connection handle (id: 0)
[20:48:41] [WARNING] cache_get_data - no active cache
[20:48:41] [ERROR] "mysql_query" - invalid connection handle (id: 0)
[20:48:41] [WARNING] cache_get_data - no active cache
[20:48:41] [ERROR] "mysql_query" - invalid connection handle (id: 0)
[20:48:41] [WARNING] cache_get_data - no active cache
[20:48:41] [ERROR] "mysql_query" - invalid connection handle (id: 0)
[20:48:41] [WARNING] cache_get_data - no active cache
[20:48:41] [ERROR] "mysql_query" - invalid connection handle (id: 0)
[20:48:41] [WARNING] cache_get_data - no active cache
Load houses:
http://pastebin.com/TyMnsnPs

Load players:
http://pastebin.com/DNg7Xj2i
Reply
#2

Are you connecting properly? (mysql_connect). Are you using the connection handle from that connection?
Reply
#3

Do a debug for the MySQL, take a look in there and see where the problems start.
Reply
#4

Its my connection:

pawn Код:
[23:22:27] [WARNING] CMySQLHandle::Create - connection already exists
pawn Код:
#define SQL_WRITE 0
#define SQL_READ 1

#define SQL_HOST "localhost"
#define SQL_DB "sampdb"

#define SQL_USER_WRITE "root"
#define SQL_USER_READ "root"

#define SQL_USER_WRITE_PASS ""
#define SQL_USER_READ_PASS ""

new g_Write;
new g_Read;
pawn Код:
forward SQL_DB_CONNECT(database);
public SQL_DB_CONNECT(database)
{
    if(database == SQL_WRITE)
    {
        g_Write = mysql_connect(SQL_HOST, SQL_USER_WRITE, SQL_DB, SQL_USER_WRITE_PASS);
        if(mysql_errno() != 0)
        {
            printf("FAILED CONNECTION TO DATABASE USING %s --- SERVER SHUTTING DOWN ~~~", SQL_USER_WRITE);
            SendRconCommand("exit");
        }
        else
        {
            printf("  SUCCESSFULLY CONNECTED TO DATABASE '%s' WITH USER '%s'", SQL_DB, SQL_USER_WRITE);
        }
    }
    else
    {
        g_Read = mysql_connect(SQL_HOST, SQL_USER_READ, SQL_DB, SQL_USER_READ_PASS);
        if(mysql_errno() != 0)
        {
            printf("FAILED CONNECTION TO DATABASE USING %s --- SERVER SHUTTING DOWN ~~~", SQL_USER_READ);
            SendRconCommand("exit");
        }
        else
        {
            printf("  SUCCESSFULLY CONNECTED TO DATABASE '%s' WITH USER '%s'", SQL_DB, SQL_USER_READ);
            print(" ");
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)