You must loop through your record set... This will work...
$dblink = mysql_connect("mysqlhost", "username", "password");
mysql_select_db("whatever db your using", $dblink);
$query = "SELECT DISTINCT session_user_id ";
$query .= "FROM $prefix1"._sessions." ";
$query .= "WHERE session_logged_in='1' ";
$query .= "AND session_time >= ".( time() - 300 );
$DBresult = mysql_query($query, $dblink);
// get each row and display it
while($row = mysql_fetch_array($dbresult))
{
echo $row[0];
}
If you want to pull back more info from that SELECT statement just add it in like this...
$dblink = mysql_connect("mysqlhost", "username", "password");
mysql_select_db("whatever db your using", $dblink);
$query = "SELECT DISTINCT session_user_id, user_name ";
$query .= "FROM $prefix1"._sessions." ";
$query .= "WHERE session_logged_in='1' ";
$query .= "AND session_time >= ".( time() - 300 );
$DBresult = mysql_query($query, $dblink);
// get each row and display it
while($row = mysql_fetch_array($dbresult))
{
echo $row[0]."<br";
echo $row[1]."<br";
}
$row[0] will be the first part of the select statement and $row[1] will be the second part for each row looped through. You can select as many data elements that are available within the table and loop through them in this manner.
Deo