이러한 테이블은 다음과 같습니다이 테이블을 어떻게 가입해야합니까?
threads:
id, date, title, text
comments:
id, thread_id, date, comment
어떻게 상단의 마지막 주석 스레드를 나열 할 것인가?
$threads = mysql_query("SELECT id, title FROM threads ORDER BY date ASC");
while ($thread = mysql_fetch_assoc($threads)) {
echo $thread['title'];
}
나는 사람들을이 일을 알아낼 수 없습니다 :
이
은 어떻게 보이는지 현재. 그래서 누군가가 내게 큰 손길을 줄 수 있다면!건배!
좋은 일. 나는 항상 GROUP BY로 그런 것들에 접근한다. +1 –