View Single Post
Old 20/01/2020, 05:09 PM   #3
xRadical3
Huge Clucker
 
xRadical3's Avatar
 
Join Date: May 2017
Location: Iran
Posts: 458
Reputation: 17
Default Re: MySQL Query Help

Quote:
Originally Posted by Calisthenics View Post
Code:
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.

Code:
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);
Thank you.
xRadical3 is offline   Reply With Quote