oke this is wat i want
Database
id | fromm | ontvanger | date | msg | gelezen
--------------------------------------------------
1 | kees | marc | time_stamp | 0
1 | hans | marc | time_stamp | 1
3 | kees | marc | time_stamp | 0
5 | selma | marc | time_stamp | 1
6 | kees | marc | time_stamp | 0
7 | kees | marc | time_stamp | 0
this is wat i want GROUP BY fromm
1 | hans | marc | time_stamp | 1
3 | kees | marc | time_stamp | 0
5 | selma | marc | time_stamp | 1
$result = mysql_query("SELECT * FROM berichten where ontvanger = '$session->username'
GROUP BY fromm ORDER BY date DESC
");
Show the latest record and gelezen is 0 first