I'm working on a PHP/MySql-site, and have run into a problem with presenting information from two tables at the same time. What I want to do is following:
The site is used for writing diarys. There are many writers writing there, and I would like to present a list with the writers names and when they last updated their diary.
I have two tables, one of them contains "uid" and "name", it's called diary_writers, and one with the diarynotes and "uid" and "date", it's called diary.
From thesse tables I select the writers names and when they wrote in their diarys the last time with:
"SELECT diary_writers.uid, diary_writers.name, diary.uid, diary.date FROM diary_writers, diary WHERE diary_writers.uid = diary.uid ORDER BY diary_writers.name, diary.date DESC"
This produces a list with the writers in alphabetical order, and all dates they have written, with the last date in the top. So far so good.
Here is my problem.
I would like to have a list that only contains the last date each writer have written, not all dates they have written.
I hav e tried to add: GROUP BY diary_writers.namebefore ORDER BY. This gives a list of the writers and the FIRST date they have written, not the last.
I have tried to change the "datesorting" but without result.
Any ideas???