php - how to skip multiple rows for one id -


hi guys use query find online friends (users have session_time >30 sec ) sometime users have multiple sessions rows in friend list 1 username repeated multiple times need know how can skip multiple sessions rows 1 user ?!thank you.

$friends_id = "95";  $time = time() - 50;      $query_b = "select session_user_id phpbb_sessions session_time > '" . $time . "' , session_user_id = '".$friends_id."'"; $result_b = mysql_query($query_b,$connect2->connect()); $row_b = mysql_fetch_array($result_b) $connect2->disconnect(); 

use distinct keyword:

select distinct session_user_id phpbb_sessions 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -