Db num rows
From SA-MP Wiki
Db num rows
Returns the number of rows from a db_query
(DBResult:dbresult)
| DBResult:dbresult | The result of db_query |
| Returns | The number of rows in the result. |
dcmd_registeredusers(playerid, params[]) { new DBResult:qresult; new string[128]; qresult = db_query(USERDB,"SELECT * FROM `users`"); format(string,sizeof(string),"Registered Users: %d", db_num_rows(qresult)); SendClientMessage(playerid,0xAFAFAFAA,string); db_free_result(qresult); }
Related Functions
The following functions might be useful as well, as they're related to this function in one way or another.
- db_open: Open an SQLite database
- db_close: Close an SQLite database
- db_query: Query an SQLite database
- db_free-result: Free result memory from a query
- db_num_rows: Get number of rows in result
- db_next_row: Move to the next row
- db_num_fields: Get number of fields in result
- db_field_name: Returns the name of a particular field
- db_get_field: Get content of field with specified ID from current result row
- db_get_field_assoc: Get content of field with specified name from current result row
