public LoadHouses() { mysql_tquery(databaseConnection, "SELECT * FROM `houses`", "OnHousesLoad"); print("test"); // Prints return 1; }
forward OnHousesLoad(); public OnHousesLoad() { print("Callback test"); // Does not print new name[128], string[64]; for(new i = 0, j = cache_get_row_count(); i <= j; i++) { print("loop test"); // Does not print Houses[i][SQLID] = cache_get_field_content_int(i, "SQLID", databaseConnection); Houses[i][CharacterSQLID] = cache_get_field_content_int(i, "CharacterSQLID", databaseConnection); Houses[i][Price] = cache_get_field_content_int(i, "Price", databaseConnection); Houses[i][Interior] = cache_get_field_content_int(i, "Interior", databaseConnection); Houses[i][VirtualWorld] = cache_get_field_content_int(i, "VirtualWorld", databaseConnection); Houses[i][hEnteranceX] = cache_get_field_content_float(i, "EnteranceX", databaseConnection); Houses[i][hEnteranceY] = cache_get_field_content_float(i, "EnteranceY", databaseConnection); Houses[i][hEnteranceZ] = cache_get_field_content_float(i, "EnteranceZ", databaseConnection); Houses[i][hExitX] = cache_get_field_content_float(i, "ExitX", databaseConnection); Houses[i][hExitY] = cache_get_field_content_float(i, "ExitY", databaseConnection); Houses[i][hExitZ] = cache_get_field_content_float(i, "ExitZ", databaseConnection); cache_get_field_content(i, "Name", name, databaseConnection, sizeof(name)); CreatePickup(1272, 1, Houses[i][hEnteranceX], Houses[i][hEnteranceY], Houses[i][hEnteranceZ], i); format(string, sizeof(string), "%s\nOwner:%s", name, GetCharacterName(Houses[i][CharacterSQLID])); Create3DTextLabel(string, -1, Houses[i][hEnteranceX], Houses[i][hEnteranceY], Houses[i][hEnteranceZ], 25, 0, 0); housesTotal++; printf("Houses loaded: %d ID: %d X: %f Y: %f Z: %f", housesTotal, Houses[i][SQLID], Houses[i][hEnteranceX], Houses[i][hEnteranceY], Houses[i][hEnteranceZ]); } }
[19:45:41] [DEBUG] mysql_tquery - connection: 0, query: "SELECT * FROM `houses`", callback: "OnHousesLoad", format: "(null)" [19:45:41] [ERROR] mysql_tquery - invalid connection handle (id: 0) [19:45:41] [DEBUG] mysql_connect - host: "127.0.0.1", user: "root", database: "db", password: "****", port: 3306, autoreconnect: true, pool_size: 2 [19:45:41] [DEBUG] CMySQLHandle::Create - creating new connection.. [19:45:41] [DEBUG] CMySQLHandle::CMySQLHandle - constructor called [19:45:41] [DEBUG] CMySQLHandle::Create - connection created (id: 1) [19:45:41] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [19:45:41] [DEBUG] CMySQLConnection::Connect - connection was successful [19:45:41] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [19:45:41] [DEBUG] mysql_errno - connection: 1 [19:45:41] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [19:45:41] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [19:45:41] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [19:45:41] [DEBUG] CMySQLConnection::Connect - connection was successful [19:45:41] [DEBUG] CMySQLConnection::Connect - connection was successful [19:45:41] [DEBUG] CMySQLConnection::Connect - connection was successful [19:45:41] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [19:45:41] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[19:45:41] [ERROR] mysql_tquery - invalid connection handle (id: 0) |