#Displaying "Total Registered Users" on website homepage in PHP (Confusion)

14 messages · Page 1 of 1 (latest)

grim compassBOT
#

@solar basin

Blocked Web TLDs

To maintain a wholesome and friendly environment we block all links to websites using certain TLDs. Your message has been deleted.

Detected TLD(s)
xxx

solar basin
#

The first message was deleted due to a mistake when I put mysql version 5.7. xxx but instead of a space it was all together. That was my mistake. Anyways I am retyping below

#

Hello 👋 Hope everyones day is going well! 😁. For the record (i am a beginner when it comes to PHP), Currently i run a website where I want to display "Total Registered Users" on the homepage of my website. Would i use something like echo? Would this pose a security risk? How would i go about accomplishing this?
Extra Info
PHP 8.3
MYSQL 5.7.X

Thank you very much in advance for taking the time to read this and help me! If i need to provide any further information to help you better assist me I can do that!

lyric valley
#

make query to count users
echo result
done

solar basin
lyric valley
#

SELECT COUNT(*) FROM users;

#

yes

solar basin
#

so it will just count the total amount of rows in users table?

#

or i have to add in some code to make sure it properly sets the correct number of rows?

#

as long as the total count = the total amount of rows in users are the same that will do.

lyric valley
#

That just counts the total amount of rows in the users table

solar basin
#

as that is a way the web application can uses to identify the account type. In my use case i am wanting to only display registered users. displaying only (example: id - 96)

lyric valley
#

You'd probably filter by user id