I want to show online user in my project where 2 field in mysql table
1st onlinestoptime and 2nd onlinestarttime
when user login and online show in mysql onlinestoptime value null
and onlinestarttime value is timestamp (show time when user online like 09/04/2016 12:01:02)
my code here but not working
so How i done and show online user
<?
date_default_timezone_set('Asia/Kolkata');
$dt=date('Y-m-d h:i:s ');
echo $sql="SELECT *FROM mytable where onlinestoptime like '%%' and onlinestarttime<'$dt' ";
$val=mysql_query($sql);
?>
Thanks in advance