Xemnas
New Member
- Messages
- 812
- Reaction score
- 0
- Points
- 0
OK, I'm trying to get an Online Now PHP script to work. I'm using a database field which stores the "last action" time. What I want to do is get that time, see if the last action time is within 10 minutes of the current time, list the user if it is and set it to null otherwise. However, I can't find a way to get 10 minutes ago. The closest I got was using mktime(), but since there isn't any way to convert Unicode, it's useless.
Here's the bit of script I'm working on:
Here's the bit of script I'm working on:
PHP:
<?php
$10_minutes_ago=date(("i")-10); // This generates an error for some reason
$time=date("h:$10_minutes_ago:s");
echo $time;
$row=0;
$query4="SELECT field_on_order from bbg_accounts WHERE field_un='$uni'";
$result4=mysql_query($query4);
$order=mysql_result($result3,0);
$query1="SELECT field_name FROM bbg_accounts WHERE field_lastaction >='$time' ORDER BY '$order'";
$query2="SELECT field_level FROM bbg_accounts WHERE field_lastaction >='$time' ORDER BY '$order'";
$query3="UPDATE bbg_accounts SET field_lastaction='' WHERE field_lastaction < '$time'";
$result=mysql_query($query1);
$result2=mysql_query($query2);
$delete_offline=mysql_query($query3);
do
{
$name=mysql_result($result,$row);
$level=mysql_result($result2,$row);
echo "<tr><td class='standardrow' width=35% align=left><font class='onoth0'> $name</font><td class='standardrow' width=10% align=center><font class='text'>$level<br />";
$row++;
}
while($name!="");
?>