D
D
Daniil Sukhikh2020-06-02 08:09:59
PHP
Daniil Sukhikh, 2020-06-02 08:09:59

What is the best way to count entries in the database?

I have a table with applications, applications have a type. New, in work, completed. What is the best way to calculate them? Through COUNT query in sql? Or through a loop already in php? You need to count how many applications by type.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Pankov, 2020-06-02
@danchikraw

SELECT type, count(*)
FROM table_name
GROUP BY type

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question