11.06.2012, 06:21
Hi, I'm trying to make it give me the result / date without the need of calling a function as I have many of these queries and making functions for similar queries would be hassle and lots of them too:
What is wrong with my code as data returns NULL:
[07:24:59] ProcessQueryThread(NoThreadResult) - Query was successful. (SELECT Date < UNIX_TIMESTAMP() FROM bans WHERE IP = '81.237.***.**')
[07:24:59] ProcessQueryThread(NoThreadResult) - Data caching enabled.
[07:24:59] CMySQLHandler::StoreResult() - Result was stored.
[07:24:59] CMySQLHandler::FreeResult() - Result was successfully free'd.
Thank you.
What is wrong with my code as data returns NULL:
[07:24:59] ProcessQueryThread(NoThreadResult) - Query was successful. (SELECT Date < UNIX_TIMESTAMP() FROM bans WHERE IP = '81.237.***.**')
[07:24:59] ProcessQueryThread(NoThreadResult) - Data caching enabled.
[07:24:59] CMySQLHandler::StoreResult() - Result was stored.
[07:24:59] CMySQLHandler::FreeResult() - Result was successfully free'd.
pawn Код:
mysql_format(MySQLConnection, MySQL, "SELECT Date < UNIX_TIMESTAMP() FROM bans WHERE IP = '%s'", plrIP);
mysql_function_query(MySQLConnection, MySQL, true, "NoThreadResult", "i", INVALID_PLAYER_ID);
new rows, fields, data[12];
cache_get_data(rows, fields);
if(rows)
{
cache_get_row(0, 0, data);
new expire = strval(data);
printf("data = %s", data);
printf("expire = %d", expire);
}