28.07.2015, 14:23
Nah, you need to fetch the values through the callback by the looks. That function appears to only be a function that formats a query into a string.
taken from https://sampwiki.blast.hk/wiki/MySQL/R33
Therefore, it should look similar to this (untested, might work tho):
pawn Код:
new query[128];
mysql_format(MySQL, query, sizeof(query), "SELECT * FROM `%s` WHERE `bar` = '%e' AND `foobar` = '%f' LIMIT %d", "foobar", "escape'me\"please", 1.2345, 1337);
// the variable 'query' contains now the formatted query (including the escaped string)
mysql_tquery(MySQL, query, "OnStuffSelected", "");
Therefore, it should look similar to this (untested, might work tho):
pawn Код:
// query somewhere
mysql_tquery(MySQL, "SELECT MIN(`column`) as `min_val` FROM `table`", "OnStuffSelected", "");
// callback
public OnStuffSelected()
{
new
rows, fields;
cache_get_data(rows, fields);
if(rows) {
new minval = cache_get_row_int(0, "min_val"); // 0 = first row
// do stuff
}
}

