View Single Post
Old 19/01/2020, 03:31 PM   #2
Join Date: May 2018
Posts: 1,229
Reputation: 205
Default Re: MySQL Query Help

result = mysql_query(1, query);
should be with correct tag of MySQL:
pawn Code:
result = mysql_query(MySQL: 1, query);
// or
result = mysql_query(MYSQL_DEFAULT_HANDLE, query);
Or you can store the connection handle returned from `mysql_connect` to a variable and use it. It is recommended when using multiple connections to mysql server.

cache_get_value_index_int(rows, result, dest);
pawn Code:
native cache_get_value_index_int(row_idx, column_idx, &destination);
COUNT() returns only 1 row. Row ids start from 0. There is only one column in SELECT list and column ids start from 0.
pawn Code:
cache_get_value_index_int(0, 0, dest);
Calisthenics is offline   Reply With Quote