[MYSQL/R39] Query not executed and no logs.
#1

Hey i have a problem with the plugin of MYSQL/R39, i have some querys in my script that not execute whitout logs, and i can't comunicate with the database. I have read the MySQL Plugin log and it only execute functions on OnGameModeInit, but if i desconnect from the server, function save_player_stats() (function that i have created for save player stats in database ) don't run.. or better, run but the queryes don't run. Yesterday all was right and now i can't comunicate with my database why? з_з

pawn Код:
new MD5_pwrd[200],pname[MAX_PLAYER_NAME],query[128],IP[16];

mysql_escape_string(inputtext,MD5_pwrd);

GetPlayerName(playerid,pname,sizeof(pname));
GetPlayerIp(playerid,IP,sizeof(IP));

mysql_format(db_connect,query,sizeof(query),"INSERT INTO samp_tabella_utenti (ID,IP,username,password) VALUES ('','%s','%s',MD5('%s'))",IP,pname,MD5_pwrd);
new Cache:results = mysql_query(db_connect,query);

if(mysql_errno(db_connect) != 1){

    new infomail[188];
    format(infomail,sizeof(infomail),"{FFFFFF}If you want, you can records your {00FF00}email{FFFFFF} in our databases so you can recive all {FF0000}news{FFFFFF} from our server.");
    SendClientMessage(playerid,-1,"{FF0000}//{FFFFFF}system: Greatings, you has been successfully registered into our databases.");
    cache_delete(results);
    ShowPlayerDialog(playerid,d_mail,DIALOG_STYLE_INPUT,"Register your email",infomail,"Done","Skip");

}else{
    cache_delete(results);
    SendClientMessage(playerid,-1,"{FF0000}//{FFFFFF}system: Fatal Error.");
    Kick(playerid);

}
For example, look this, this script, must pass the email that user type in dialog at database table. But mysql_query would appear not working, becouse when i check in mysql plugin log this is result:



very strange o:
Reply
#2

No one can help me ?!
Reply
#3

it is really very strange, cuz some function that call mysql_query, in ongamemodeinit works....

Quote:

//... continue
[10:13:01] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "ammuitms_7", data: "300"
[10:13:01] [DEBUG] cache_get_field_content_int - row: 4, field_name: "priceammuitms_7", connection: 1
[10:13:01] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "priceammuitms_7", data: "1000"
[10:13:01] [DEBUG] cache_get_field_content_int - row: 4, field_name: "ammuitms_8", connection: 1
[10:13:01] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "ammuitms_8", data: "300"
[10:13:01] [DEBUG] cache_get_field_content_int - row: 4, field_name: "priceammuitms_8", connection: 1
[10:13:01] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "priceammuitms_8", data: "1000"
[10:13:01] [DEBUG] cache_get_field_content_int - row: 4, field_name: "ammuitms_9", connection: 1
[10:13:01] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "ammuitms_9", data: "300"
[10:13:01] [DEBUG] cache_get_field_content_int - row: 4, field_name: "priceammuitms_9", connection: 1
[10:13:01] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "priceammuitms_9", data: "10000"
[10:13:01] [DEBUG] cache_get_field_content_int - row: 4, field_name: "ammuitms_10", connection: 1
[10:13:01] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "ammuitms_10", data: "300"
[10:13:01] [DEBUG] cache_get_field_content_int - row: 4, field_name: "priceammuitms_10", connection: 1
[10:13:01] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "priceammuitms_10", data: "0"
[10:13:01] [DEBUG] cache_get_field_content_int - row: 4, field_name: "ammuitms_11", connection: 1
[10:13:01] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "ammuitms_11", data: "300"
[10:13:01] [DEBUG] cache_get_field_content_int - row: 4, field_name: "priceammuitms_11", connection: 1
[10:13:01] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "priceammuitms_11", data: "1"
[10:13:01] [DEBUG] cache_get_field_content_int - row: 4, field_name: "illegalitms_0", connection: 1
[10:13:01] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "illegalitms_0", data: "200"
[10:13:01] [DEBUG] cache_get_field_content_int - row: 4, field_name: "priceillegalitms_0", connection: 1
[10:13:01] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "priceillegalitms_0", data: "500"
[10:13:01] [DEBUG] cache_get_field_content_int - row: 4, field_name: "illegalitms_1", connection: 1
[10:13:01] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "illegalitms_1", data: "200"
[10:13:01] [DEBUG] cache_get_field_content_int - row: 4, field_name: "priceillegalitms_1", connection: 1
[10:13:01] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "priceillegalitms_1", data: "0"
[10:13:01] [DEBUG] cache_get_field_content_int - row: 4, field_name: "illegalitms_2", connection: 1
[10:13:01] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "illegalitms_2", data: "200"
[10:13:01] [DEBUG] cache_get_field_content_int - row: 4, field_name: "priceillegalitms_2", connection: 1
[10:13:01] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "priceillegalitms_2", data: "0"
[10:13:01] [DEBUG] cache_get_field_content_int - row: 4, field_name: "illegalitms_3", connection: 1
[10:13:01] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "illegalitms_3", data: "200"
[10:13:01] [DEBUG] cache_get_field_content_int - row: 4, field_name: "priceillegalitms_3", connection: 1
[10:13:01] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "priceillegalitms_3", data: "0"
[10:13:01] [DEBUG] cache_get_row_count - connection: 1
[10:13:01] [DEBUG] cache_delete - cache_id: 1, connection: 1
[10:13:01] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called
[10:13:01] [DEBUG] CMySQLHandle:eleteSavedResult - result deleted
[10:13:23] [DEBUG] mysql_format - connection: 1, len: 128, format: "SELECT * FROM samp_tabella_utenti WHERE username = '%s'"
[10:13:23] [DEBUG] mysql_query - connection: 1, query: "SELECT * FROM samp_tabella_utenti WHERE username = 'test'", use_cache: true
[10:13:23] [DEBUG] CMySQLQuery::Execute - starting query execution
[10:13:23] [DEBUG] CMySQLQuery::Execute - query was successfully executed within 0.538 milliseconds
[10:13:23] [DEBUG] CMySQLResult::CMySQLResult() - constructor called
[10:13:23] [DEBUG] CMySQLHandle::SaveActiveResult - cache saved (id: 1)
[10:13:23] [DEBUG] cache_get_row_count - connection: 1
[10:13:23] [DEBUG] cache_delete - cache_id: 1, connection: 1
[10:13:23] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called
[10:13:23] [DEBUG] CMySQLHandle:eleteSavedResult - result deleted

but after the same callback....

Quote:

[10:14:44] [DEBUG] mysql_escape_string - source: "*****", connection: 1, max_len: 200
[10:14:44] [DEBUG] mysql_format - connection: -255, len: 128, format: "SELECT * FROM samp_tabella_utenti WHERE username = '%s' AND password = MD5('%s')"
[10:14:44] [ERROR] "mysql_format" - invalid connection handle (id: -255)
[10:14:44] [DEBUG] mysql_query - connection: -255, query: "", use_cache: true
[10:14:44] [ERROR] "mysql_query" - invalid connection handle (id: -255)
[10:14:44] [DEBUG] cache_get_data - connection: 1
[10:14:44] [WARNING] cache_get_data - no active cache

[10:14:46] [DEBUG] mysql_escape_string - source: "*******", connection: 1, max_len: 200
[10:14:46] [DEBUG] mysql_format - connection: -255, len: 128, format: "SELECT * FROM samp_tabella_utenti WHERE username = '%s' AND password = MD5('%s')"
[10:14:46] [ERROR] "mysql_format" - invalid connection handle (id: -255)
[10:14:46] [DEBUG] mysql_query - connection: -255, query: "", use_cache: true
[10:14:46] [ERROR] "mysql_query" - invalid connection handle (id: -255)
[10:14:46] [DEBUG] cache_get_data - connection: 1
[10:14:46] [WARNING] cache_get_data - no active cache

[10:16:01] [DEBUG] mysql_unprocessed_queries - connection: 1

[10:16:01] [DEBUG] mysql_format - connection: -255, len: 128, format: "SELECT * FROM samp_tabella_utenti WHERE username = '%s'"
[10:16:01] [ERROR] "mysql_format" - invalid connection handle (id: -255)
[10:16:01] [DEBUG] mysql_query - connection: -255, query: "", use_cache: true
[10:16:01] [ERROR] "mysql_query" - invalid connection handle (id: -255)
[10:16:01] [DEBUG] cache_get_row_count - connection: 1
[10:16:01] [WARNING] cache_get_row_count - no active cache
I don't understand why... if you see it return..

invalid connection handle (id:-255), but this mysql query is called with the same syntax and logic of all the others..
Reply
#4

WOW, i have solved, but i still don't understand, why happened this:

In callback OnPlayerConnect, i have this:
pawn Код:
for (new t = 0; t < MAX_LEGAL_BIZ_ITEMS; t++){tmp_selection_legal[playerid][t] = -1;}
for (new t = 0; t < MAX_ILLEGAL_BIZ_ITEMS; t++){tmp_selection_illegal[playerid][t] = -1;}
for (new t = 0; t < MAX_AMMUNATION_ITEMS; t++){tmp_selection_ammu[playerid][t] = -1;}

for (new t = 0; t < MAX_LEGAL_BIZ_ITEMS; t++){player_info_legal_items[playerid][t] = -1;}
for (new t = 0; t < MAX_AMMUNATION_ITEMS; t++){player_info_ammu_items[playerid][t] = -1;}
when i have commented it, all return to normality.. but why ?! :O
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)