13.04.2017, 05:35
NEVER use num_rows if the only thing you're intersted in is a count of something. You do not need to process the entire resultset (which could be thousands of records) if you only want one single number.
That generates exactly one row with one column. Then retrieve that value like you would any other integer.
I'm pretty sure the mybb database uses auto_increment, i.e. it generates the id automatically for each new insert.
PHP код:
SELECT COUNT(*) FROM `mybb_users`
I'm pretty sure the mybb database uses auto_increment, i.e. it generates the id automatically for each new insert.


