Need help how to display the number of registered users from the database on the HTML page of the site, Example (Site Users 45)

Closed due to the fact that the question is too general for the participants andreymal , Jarvis_J , default locale , 0xdb , Sergey Glazirin Jun 27 '18 at 5:09 .

Please correct the question so that it describes the specific problem with sufficient detail to determine the appropriate answer. Do not ask a few questions at once. See “How to ask a good question?” For clarification. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • 3
    Request the number of users from the database and embed the result in the html-code of the page - andreymal
  • one
    I always like such questions so much))) give the code as you tried to display them, if at all. Questions of this kind are not asked here, Google to help "How to count the number of records in mysql php" - madfan41k

1 answer 1

If the problem is in the database query, then here is a simple sql query that displays the number of rows found:

SELECT COUNT(*) AS `user_count` FROM `user` 

In the end, if there is a condition we add to the request (for example):

 WHERE `user`.`type` = 1 

If you don’t understand anything at all and don’t know how and what is arranged, then read better the php functions first and start with the simple how to get data from the database using php.