firefoxinc
08-21-2009, 05:32 AM
I am working on a query for a php/sql database I am building.
SELECT
users.ID,
users.username,
users.authlevel,
rankdate.rdrid,
rankdate.rddate
FROM
users ,
rankdate
WHERE
rankdate.rduid = users.ID
This is what it would return
id username authlevel rdrid rddate
1 FireFox 8 O-4 2009-05-20
1 FireFox 8 O-3 2009-05-15
2 Xyekep 8 O-2 2009-07-26
Now the timestamp is there date of rank. The rankdate table records when they where promoted to what rank. FireFox has 2 entrys so it shows up twice. Is there a way so set the query up so it only displayes the most resent date of rank entry. Example
1 FireFox 8 O-4 2009-05-20
2 Xyekep 8 O-2 2009-07-26
I would like to the whole" while($row = mysql_fetch_row($query))" to make a simple list of everyone in the database and there current rank.
Any tips or suggestions on how I could do this?
SELECT
users.ID,
users.username,
users.authlevel,
rankdate.rdrid,
rankdate.rddate
FROM
users ,
rankdate
WHERE
rankdate.rduid = users.ID
This is what it would return
id username authlevel rdrid rddate
1 FireFox 8 O-4 2009-05-20
1 FireFox 8 O-3 2009-05-15
2 Xyekep 8 O-2 2009-07-26
Now the timestamp is there date of rank. The rankdate table records when they where promoted to what rank. FireFox has 2 entrys so it shows up twice. Is there a way so set the query up so it only displayes the most resent date of rank entry. Example
1 FireFox 8 O-4 2009-05-20
2 Xyekep 8 O-2 2009-07-26
I would like to the whole" while($row = mysql_fetch_row($query))" to make a simple list of everyone in the database and there current rank.
Any tips or suggestions on how I could do this?