hi there. i am running PHPBB here -
http://www.hiphopmusic.co.uk/phpbb
there is a loop at the bottom, that checks who is online, and if anyone is logged in, prints their usernames seperated by commas. However, the last username in the list (if anyone is logged in) still has a comma after it. How do i make it so that the last one in the list does not have a following comma.
ThanksCode:$sql = "SELECT * FROM whosonline"; if(!$result = mysql_query($sql, $db)) die("Error - Could not connect to the database</table></table></table>"); if($myrow = mysql_fetch_array($result)) { do { if(!stristr($myrow[username], "Guest")) { $thisuser = get_userdata($myrow[username], $db); echo "<font face='verdana' size='1'><a href=\"$url_phpbb/bb_profile.php?mode=view&user=$thisuser[user_id]\">$thisuser[username]</a></font>, \n"; } else { if ($users_online==1) { echo "<font face='verdana' size='1'>There are no members browsing the forums, and $users_online guest. </font>\n"; break; } else { echo "<font face='verdana' size='1'>There are no members browsing the forums, and $users_online guests. </font>\n"; break; } } }
j





Bookmarks