Grouping by Name

wxdqz

New Member
Hi,I've got the following two tables in my db.Users+----+----------+| id | username |+----+----------+| 1 | Gill || 2 | Bob |+----+----------+User Logins+----+---------+-------------+-------------+| id | user_id | ip | time |+----+---------+-------------+-------------+| 1 | 1 | 127.0.0.1 | 200103161050|| 1 | 2 | 127.0.0.1 | 200103161050|| 1 | 2 | 127.0.0.1 | 200103161050|| 1 | 1 | 127.0.0.1 | 200103161050|+----+---------+-------------+-------------+How can i do a join on these two tables to return the data in such a way that I can print it out like:BobLogged in on [date here] from [ip here]Logged in on [date here] from [ip here]Logged in on [date here] from [ip here]GillLogged in on [date here] from [ip here]Logged in on [date here] from [ip here]Logged in on [date here] from [ip here]Any ideas?Cheers fro any help,Jord
 
Back
Top