Quote:
Originally Posted by Calisthenics
Code:
cache_get_field_content_int(0, registered, mysql);
pawn Code:
native cache_get_field_content_int(row, const field_name[], connectionHandle = 1);
It expects a column name to search for but `registered` is empty. The correct way would be:
pawn Code:
new Cache:aresult = mysql_query(mysql, "SELECT COUNT(*) AS total_accounts FROM `accounts`"), registered = cache_get_field_content_int(0, "total_accounts", mysql);
or
pawn Code:
new Cache:aresult = mysql_query(mysql, "SELECT COUNT(*) FROM `accounts`"), registered = cache_get_row_int(0, 0, mysql);
But you do not need a SELECT query at all. When you execute an INSERT query with auto increment, you retrieve the number generated (account ID) with `cache_insert_id`. This is how many players have registered (including deleted accounts).
|
Thanks.. It's working. I just need to make it "register+1" to include the registered player... REP+