How do I show metrics with PHP or Javascript

Jazzy 1012
Jazzy 1012 used Ask the Experts™
on
I want to be able to display some metrics on my webpage, for example "How many users I have"
How am I able to do this? Is it better with php or javascript?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Do you want to display this metrics from the database? or Is it static information that you want to show it on the page?

PHP is a server side scripting language where the code runs on the webserver and sends the output to the browser(as HTML)
http://php.net/manual/en/intro-whatis.php

Javascript is Client side scripting language where the code runs on browser and used for performing actions on the browser.

Author

Commented:
I want to show metrics from my database
Most Valuable Expert 2011
Top Expert 2016

Commented:
I think the PHP approach is the right one.  As PHP prepares the HTML document, it can access the information in the database and use this information to inject the metrics into appropriate HTML tags.  PHP can also control the CSS styling of these tags, so you can set the location, size, color and other information related to the display of your metrics.
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
Yes but can you show me an example, Im not sure how to build a metrics with php
greetings Jasmine Ikhreishi , , You ask for something in a very general way -
    "how to build a metrics with php "

But there can be many, many different meanings for   "build a metrics" and what you think you need or want to be displayed on a web page. Also there may be different things to consider in PHP for using a database TABLE with columns to hold information that might be used on any storage and filtered retrieval of rows of your metric informations.

Can you tell us more about what kind of web page display you need or have in mind, AND how much and what kind of numerical output you may want to be on a page. Please tell us more about what the database is storing in the table, and what your goal is for the PHP page output to look like.
Most Valuable Expert 2011
Top Expert 2016
Commented:
"Metrics" is a pretty broad term.  We will need to narrow the definition down a bit!

If you have a value in your database that you want to show on the browser viewport, you can find any number of good PHP / MySQL learning resources in this article.  After you  understand the basics, it's just "clone, hack, repeat" until you get the HTML and CSS right, then hook up your PHP and database query to put the data into your HTML document.  It's not hard, but it's an iterative process with a lot of moving parts -- in other words, it's a project with a work product, not a question with an answer that we can post in a forum.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial