-
User System-Help
I was Testing this User System and i was trying to add the online users but without success, i made the total user script and it works great but for the online nothing..could someone plz help me??
PHP Code:
<?php
ob_start();
include("config.php");
$table = 'usersystem';//Sets the table name
$totalusers = mysql_num_rows(mysql_query("SELECT id FROM $table"));
echo "<br /><font size='1' face='Verdana'><b>Utenti Totali:</b> $totalusers</font><br />";// Echoes the total users
?>
this is for the total user online
if u need else to help me,just ask...
thanks in advance for helping me out
It's Based od Techtuts System
-
i would have thoguht the table name would have been something along the lines of
users_online
the database would be called usersystem
PHP Code:
<?php
ob_start();
include("config.php");
$table = 'users_online'; //Sets the table name
$query = mysql_query("SELECT * FROM $table") or die("ERROR: ".mysql_error());
$num = mysql_num_rows($query);
echo "<br /><font size='1' face='Verdana'><b>Utenti Totali:</b> $num</font><br />";// Echoes the total users
?>
-
Nice ++++
And to get thier Username???
-
Ooppsss.
trying this code i found out that it shows the total users not the current online users :S:@
-
PHP Code:
<?php
ob_start();
include("config.php");
$table = 'users_online'; //Sets the table name
$view = mysql_query("SELECT * FROM $table") or die ("Error!");
echo("");
$checkview = mysql_num_rows($view);
while($getview = mysql_fetch_array($view))
{
echo "<br /><font size='1' face='Verdana'><b>Utenti Totali:</b>{$getuser['username']} </font><br />";
}
?>
That will display all the users that are online with their usernames