[PHP-DB] RE: [PHP] Re: [PHP-DB] Query - Grouping Results

2001-03-19 Thread Jeff Armstrong
-DB] Query - Grouping Results You can put this : SELECT users.name AS name, user_logins.ip AS ip, UNIX_TIMESTAMP(user_logins.time) AS time FROM users, user_logins WHERE user_logins.user_id = users.id ORDER BY time ASC GROUP BY users.name See the GROUP BY statement at mysql docs. Mario H.C.T

[PHP] Re: [PHP-DB] Query - Grouping Results

2001-03-19 Thread Mario Henrique Cruz Torres
You can put this : SELECT users.name AS name, user_logins.ip AS ip, UNIX_TIMESTAMP(user_logins.time) AS time FROM users, user_logins WHERE user_logins.user_id = users.id ORDER BY time ASC GROUP BY users.name See the GROUP BY statement at mysql docs. Mario H.C.T. Jordan Elver wrote: > Hi, > I'

[PHP-DB] Query - Grouping Results

2001-03-19 Thread Jordan Elver
Hi, I've got a table like: id user_id ip time 1 2 127.0.0.1 20010316105018 Etc, etc. I do a join on the this table and the users table to get the coresponding username to user_id like this: SELECT users.name AS name, user_logins.ip AS ip, U