I am trying to script a PHP script to connect to my MySQL database to tell me how many people have registered to my forums by counting the records in the table.
The PHP script should display the total of records above "Users Registered"
I don't know if I am correct but I am using this PHP script to count the records:
<li>
<?php
$result = mysql_query(SELECT COUNT(uid) FROM mybb_users);
$total = mysql_num_rows($result);
?>
<span>Users registered</span>
</li>
The way the javascript allows the data to show on the webpage is when the HTML tag <strong data-number="0"></strong>
is used.
I believe the HTML tag links to the "main.js" file. The JavaScript function is:
facts: function() {
var $eleNumber;
$('.facts li:not(.break)').each(function() {
$eleNumber = $(this).find('strong');
$eleNumber.animateNumbers($eleNumber.attr('data-number'));
});
},
The only way the webpage show the values is by this script for example: Image of Website script
It would now show 100, 000 on "Players"
Like is it possible to script the "echo" or "print" in an HTML tag for example...
<strong data-number="The total number of records"></strong>
I do not know how this works, but like convert the PHP Script to work with the JAVASCRIPT function..
I am very sorry for a unclear question, thing is I can't quite explain the problem itself, I could be completely wrong and have tried researching