Hey everyone.
I am trying to show currently active users. It worked on my server but it will not show up on my live server.
navigate.php
<?php
error_reporting(E_ALL);
include "/home/jayden1/database_access/dblogincheck.php";
if(isset($_SESSION['username'])){
$user = $_SESSION['username'];
$date = date('c');
mysql_query("replace into navigate ( username, time ) values('$user','$date')");
}
?>
showing the list
<?php
error_reporting(E_ALL);
include ("/home/jayden1/database_access/dblogincheck.php");
include ("navigate.php");
$d=date('c',time()-5*60);//last 5 minutes
$q=mysql_query("SELECT `username` FROM `navigate` WHERE time>'$d'") or die ("query failed to find".mysql_error());
if(mysql_affected_rows()>0){
print "<ul>";
while($users=mysql_fetch_array($q)){
print "<li>{$users[0]}</li>";
}
print "</ul>";
}
?>
I just seen that it isn't posting it into the db. Anyone know what I am doing wrong?