好的,这就是我想要的
数据库
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
这是我想要的 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
");
显示最新记录,gelezen 为 0 第一