0
AndriusPL prieš 9 metus
CMD:ttt(playerid, params[])
{
new uQuerry[150];
format(uQuerry, sizeof(uQuerry), "SELECT FROM_UNIXTIME(adminlaikas) AS adminlaikas FROM vartotojai WHERE Vardas = '%s'",GetName(playerid));
mysql_query(uQuerry);
mysql_store_result();
if(mysql_num_rows())
{
new result[150];
mysql_fetch_field_row(result, "adminlaikas");
new grazidata = strval(result);
new msgas[500];
format(msgas,sizeof(msgas),"Dabar rodo admin: %i",grazidata);
SendClientMessage(playerid, -1,msgas);
}
mysql_free_result();
return 1;
}
P.S nekreipk dėmesio į lygiavimą, čia test komanda. Mysql log:
[22:11:56] CMySQLHandler::FreeResult() - Result was successfully free'd.
[22:11:59] >> mysql_query( Connection handle: 1 )
[22:11:59] CMySQLHandler::Query(SELECT FROM_UNIXTIME(adminlaikas) AS adminlaikas FROM vartotojai WHERE Vardas = 'Andrius_Suboku') - Successfully executed.
[22:11:59] >> mysql_store_result( Connection handle: 1 )
[22:11:59] CMySQLHandler::StoreResult() - Result was stored.
[22:11:59] >> mysql_num_rows( Connection handle: 1 )
[22:11:59] CMySQLHandler::NumRows() - Returned 1 row(s)
[22:11:59] >> mysql_fetch_field_row( Connection handle: 1 )
[22:11:59] CMySQLHandler::FetchField(adminlaikas) - You cannot call this function now. (Reason: Fields/Rows are empty.)
[22:11:59] >> mysql_free_result( Connection handle: 1 )
[22:11:59] CMySQLHandler::FreeResult() - Result was successfully free'd.
Kaip suprantu rodo kad tipo tusčia, nors tikrai nėra tusčia.