only one Posted February 9, 2007 Share Posted February 9, 2007 code: <?php include("cons.php"); $date = date("Yjm"); $time = date("Gi"); mysql_query("UPDATE `clanusers` SET `time` = '$time', `date` = '$date' WHERE '$user' = `username`"); $info = mysql_query("SELECT * FROM clanusers"); while ($r = mysql_fetch_array($info)) { $rank2 = $r['rank']; $date1 = $r['date']; $time1 = $r['time']; $name = $r['username']; $date2 = date("Yjm"); $time2 = $time1 + 0005; $color2 = $r['color']; if($date2==$date1){ if($time<$time2){ $info2 = mysql_query("SELECT rank FROM ranks WHERE `rankno` = '$rank2'"); while ($r2 = mysql_fetch_array($info2)) { $rank3 = $r2['rank']; echo "<b><a href='?page=Profile&userna=$name'><title='Rank: $rank3'><font face=\"Arial, Helvetica, sans-serif\" font size=\"1\" color=\"$color2\">$name</font></title></a> <font color=#cccccc face=Arial size=1>|</font> </b>"; }}}} mysql_error(); ?> doesnt show whos online for some reason, it works fine without the the ranks bit Quote Link to comment https://forums.phpfreaks.com/topic/37769-usersonline/ Share on other sites More sharing options...
Jessica Posted February 9, 2007 Share Posted February 9, 2007 You need to post your code within the code tags, so we can see what is really going on there. And keep proper indentation. Quote Link to comment https://forums.phpfreaks.com/topic/37769-usersonline/#findComment-180667 Share on other sites More sharing options...
only one Posted February 9, 2007 Author Share Posted February 9, 2007 <?php include("cons.php"); $date = date("Yjm"); $time = date("Gi"); mysql_query("UPDATE `clanusers` SET `time` = '$time', `date` = '$date' WHERE '$user' = `username`"); $info = mysql_query("SELECT * FROM clanusers"); while ($r = mysql_fetch_array($info)) { $rank2 = $r['rank']; $date1 = $r['date']; $time1 = $r['time']; $name = $r['username']; $date2 = date("Yjm"); $time2 = $time1 + 0005; $color2 = $r['color']; if($date2==$date1){ if($time<$time2){ $info2 = mysql_query("SELECT rank FROM ranks WHERE `rankno` = '$rank2'"); while ($r2 = mysql_fetch_array($info2)) { $rank3 = $r2['rank']; echo "<a href='?page=Profile&userna=$name'><title='Rank: $rank3'><font face=\"Arial, Helvetica, sans-serif\" font size=\"1\" color=\"$color2\">$name</font></title>[/url] <font color=#cccccc face=Arial size=1>|</font> "; }}}} mysql_error(); ?> Quote Link to comment https://forums.phpfreaks.com/topic/37769-usersonline/#findComment-180668 Share on other sites More sharing options...
only one Posted February 9, 2007 Author Share Posted February 9, 2007 lol im so stupid, i closed the while too late Quote Link to comment https://forums.phpfreaks.com/topic/37769-usersonline/#findComment-180717 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.