Db num rows

From SA-MP Wiki

Jump to: navigation, search

Db num rows


Returns the number of rows from a db_query


Parameters:
(DBResult:dbresult)
DBResult:dbresultThe result of db_query


ReturnsThe 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_num_rows: Get number of rows in result
  • db_get_field: Get content of field with specified ID from current result row
Personal tools
In other languages