Hi All I'm looking for some quick help with this snippet. There are 2 tables involved: users and ip_logs. Everytime a user signs in, their ip address is recorded as a new row in the db. So this script is meant to check which users log in from the same IP address and display their username. So username from the users table and ip from the ip_logs table. Thanks! $sqlip="SELECT * from ip_logs where userID='".$data['id']."'"; $queryip=$DB->query($sqlip); $rowip=$DB->fetch_array($queryip); echo '<b>IP ADDRESS :</b><br />'; $sql="SELECT users.id as id, users.username as username FROM users, ip_logs WHERE users.id = ip_logs.userID AND ip_logs.ip = '".$rowip['ip']."'"; $query=$DB->query($sql); if($DB->num_rows($query)>0) { while($row=$DB->fetch_array($query)) { echo '<a href="index.php?module=user&act=edit&id='.$row['id'].'">'.$row['username'].'</a>, '; } } echo "<br />"; PHP:
Well, i am not too sure about the specific solution - but i've got lot of help from a handy website called Free Online Programming Tutorials - probably you can also try your luck over there as well.