I have a vbulletin forum. What I need is, that last value from table "userid" shows on a HTML page using "include php"
Actually I want to show the number of users on the main page of my website, which in HTML format. But that should be in the form of "2,000" if the last value is 2000
Is it possible?
Right now I am using this PHP to extract the value and then using include tags in HTML page to fetch this file
PHP Code:
<?php
$con = mysql_connect("localhost","username","pass");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("database", $con);
$result = mysql_query("SELECT userid FROM user ORDER BY userid DESC LIMIT 0,1");
echo "<table border='0'>";
echo "<tr>";
while($row = mysql_fetch_array($result))
{
echo "<td style='color:#FF0000 '>" . $row['userid'] . "</td>";
}
{
echo "<td>Users Online & counting. Are you one of them?</td>";
}
{
echo "</tr>";
}
echo "</table>";
mysql_close($con);
?>