Good afternoon.
Task:
Having obtained a sample from the database in the usual way (SELECT * FROM table WHERE param=12) into the $result variable, you need to count the number of rows obtained from the database. Without *foreach*. count(array) *foreach*. count(array) - as you understand it does not consider such an array.