17.02.2014, 16:56
pawn Code:
new string[1024];
mysql_format(db, string, sizeof(string), "SELECT * FROM smsid WHERE saaja = %i AND kustutatudsaajal = 0 ORDER BY id DESC LIMIT 50", KasutajaInfo[playerid][mTelefon]);
new Cache:r = mysql_query(db, string);
strcpy(telefoniquery[playerid], string);
new rows = mysql_num_rows(), result[48], varv[12];
if (rows)
{
strcpy(string, "");
for (new i; i < rows; i++)
{
cache_get_field_content(i, "sisu", result);
if (cache_get_field_content_int(i, "loetud")) strcpy(varv, COL_WHITE);
else strcpy(varv, COL_RED);
format(result, sizeof(result), "%s%s - %s", varv, NumberKontakt(playerid, cache_get_field_content_int(i, "saatja")), result);
format(string, sizeof(string), "%s%s\n", string, result);
}
ShowPlayerDialog(playerid, DIALOG_SMSID, DIALOG_STYLE_LIST, COL_WHITE"Telefon", string, "Vali", "Tagasi");
}
else ShowPlayerDialog(playerid, DIALOG_SMSINFO, DIALOG_STYLE_MSGBOX, COL_WHITE"Telefon", COL_WHITE"Vastuvхetud sхnumid puuduvad!", "Tagasi", "");
cache_delete(r);

Edit:
Code:
19:57:08 mysql_format OK connection: 1, len: 1024, format: "SELECT * FROM smsid WHERE saaja = %i AND kustutatudsaajal = 0 ORDER BY id DESC LIMIT 50"
19:57:08 mysql_query OK connection: 1, query: "SELECT * FROM smsid WHERE saaja = 1337 AND kustutatudsaajal = 0 ", use_cache: true
19:57:08 CMySQLQuery::Execute OK starting query execution
19:57:08 CMySQLQuery::Execute OK query was successfully executed within 0.383 milliseconds
19:57:08 CMySQLResult::CMySQLResult() OK constructor called
19:57:08 CMySQLHandle::SaveActiveResult OK cache saved (id: 18)
19:57:08 cache_get_row_count OK connection: 1
19:57:08 cache_get_field_content OK row: 0, field_name: "sisu", connection: 1, max_len: 48
19:57:08 CMySQLResult::GetRowDataByName OK row: '0', field: "sisu", data: "tere"
19:57:08 cache_get_field_content_int OK row: 0, field_name: "loetud", connection: 1
19:57:08 CMySQLResult::GetRowDataByName OK row: '0', field: "loetud", data: "1"
19:57:08 cache_get_field_content_int OK row: 0, field_name: "saatja", connection: 1
19:57:08 CMySQLResult::GetRowDataByName OK row: '0', field: "saatja", data: "1337"
19:57:08 mysql_format OK connection: 1, len: 128, format: "SELECT * FROM kontaktid WHERE lisaja = %i AND telefon = %i"
19:57:08 mysql_query OK connection: 1, query: "SELECT * FROM kontaktid WHERE lisaja = 1337 AND telefon = 1337", use_cache: true
19:57:08 CMySQLQuery::Execute OK starting query execution
19:57:08 CMySQLQuery::Execute OK query was successfully executed within 0.122 milliseconds
19:57:08 CMySQLResult::CMySQLResult() OK constructor called
19:57:08 CMySQLHandle::SaveActiveResult OK cache saved (id: 13)
19:57:08 cache_get_row_count OK connection: 1
19:57:08 cache_get_field_content OK row: 0, field_name: "nimi", connection: 1, max_len: 128
19:57:08 CMySQLResult::GetRowDataByName OK row: '0', field: "nimi", data: "mina ise"
19:57:08 cache_get_field_content OK row: 1, field_name: "sisu", connection: 1, max_len: 48
19:57:08 CMySQLResult::GetRowDataByName() ERROR invalid row index ('1')
19:57:08 cache_get_field_content_int OK row: 1, field_name: "loetud", connection: 1
19:57:08 CMySQLResult::GetRowDataByName() ERROR invalid row index ('1')
19:57:08 cache_get_field_content_int ERROR invalid datatype
19:57:08 cache_get_field_content_int OK row: 1, field_name: "saatja", connection: 1
19:57:08 CMySQLResult::GetRowDataByName() ERROR invalid row index ('1')
19:57:08 cache_get_field_content_int ERROR invalid datatype
19:57:08 mysql_format OK connection: 1, len: 128, format: "SELECT * FROM kontaktid WHERE lisaja = %i AND telefon = %i"
19:57:08 mysql_query OK connection: 1, query: "SELECT * FROM kontaktid WHERE lisaja = 1337 AND telefon = 0", use_cache: true
19:57:08 CMySQLQuery::Execute OK starting query execution
19:57:08 CMySQLQuery::Execute OK query was successfully executed within 0.101 milliseconds
19:57:08 CMySQLResult::CMySQLResult() OK constructor called
19:57:08 CMySQLHandle::SaveActiveResult OK cache saved (id: 8)
19:57:08 cache_get_row_count OK connection: 1
19:57:08 cache_get_field_content OK row: 2, field_name: "sisu", connection: 1, max_len: 48
19:57:08 CMySQLResult::GetRowDataByName() ERROR invalid row index ('2')
19:57:08 cache_get_field_content_int OK row: 2, field_name: "loetud", connection: 1
19:57:08 CMySQLResult::GetRowDataByName() ERROR invalid row index ('2')
19:57:08 cache_get_field_content_int ERROR invalid datatype
19:57:08 cache_get_field_content_int OK row: 2, field_name: "saatja", connection: 1
19:57:08 CMySQLResult::GetRowDataByName() ERROR invalid row index ('2')
19:57:08 cache_get_field_content_int ERROR invalid datatype
19:57:08 mysql_format OK connection: 1, len: 128, format: "SELECT * FROM kontaktid WHERE lisaja = %i AND telefon = %i"
19:57:08 mysql_query OK connection: 1, query: "SELECT * FROM kontaktid WHERE lisaja = 1337 AND telefon = 0", use_cache: true
19:57:08 CMySQLQuery::Execute OK starting query execution
19:57:08 CMySQLQuery::Execute OK query was successfully executed within 0.89 milliseconds
19:57:08 CMySQLResult::CMySQLResult() OK constructor called
19:57:08 CMySQLHandle::SaveActiveResult OK cache saved (id: 19)
19:57:08 cache_get_row_count OK connection: 1
19:57:08 cache_get_field_content OK row: 3, field_name: "sisu", connection: 1, max_len: 48
19:57:08 CMySQLResult::GetRowDataByName() ERROR invalid row index ('3')
19:57:08 cache_get_field_content_int OK row: 3, field_name: "loetud", connection: 1
19:57:08 CMySQLResult::GetRowDataByName() ERROR invalid row index ('3')
19:57:08 cache_get_field_content_int ERROR invalid datatype
19:57:08 cache_get_field_content_int OK row: 3, field_name: "saatja", connection: 1
19:57:08 CMySQLResult::GetRowDataByName() ERROR invalid row index ('3')
19:57:08 cache_get_field_content_int ERROR invalid datatype
19:57:08 mysql_format OK connection: 1, len: 128, format: "SELECT * FROM kontaktid WHERE lisaja = %i AND telefon = %i"
19:57:08 mysql_query OK connection: 1, query: "SELECT * FROM kontaktid WHERE lisaja = 1337 AND telefon = 0", use_cache: true
19:57:08 CMySQLQuery::Execute OK starting query execution
19:57:08 CMySQLQuery::Execute OK query was successfully executed within 0.84 milliseconds
19:57:08 CMySQLResult::CMySQLResult() OK constructor called
19:57:08 CMySQLHandle::SaveActiveResult OK cache saved (id: 20)
19:57:08 cache_get_row_count OK connection: 1
19:57:08 cache_delete OK cache_id: 18, connection: 1
19:57:08 CMySQLResult::~CMySQLResult() OK deconstructor called
19:57:08 CMySQLHandle::DeleteSavedResult OK result deleted
