원리는 디렉토리 구조에서 따오면 되겠죠.
각 글들은 자기 나름대로의 유일번호를 가지게 되니까 그것을 인덱스로
잡고...
자신의 Root(Main글)가 있는지 없으면 그건 일반 게시글이겠고 있다면
그것은 다른 글에 딸린 글이 되니까 답글이 되겠죠.
이 원리는 한번만 잡아놓으면 계속 연장해서 답글의 답글까지 갈 수도
있겠죠.
자세한것은 JSBoard소스를 보시면 나오겠지만...
간단한 DB구조는
Index, SubIndex, ...
이렇게 되겠죠?
여기서 먼저 SubIndex가 0(or -1)인 글을 찾고 각 Index를 가지는
SubIndex를
찾아 위치시키면... 원하는 모양이 나오겠죠.
SQL만 잘 손봐도 Sub Query를 사용하면 1번에 모두 왕창 불러올 수 있다고
하는데 안해봐서 모르겠네요.
그럼 성공 하시길... )
Re: 답글 올리는 소스좀?
원리는 디렉토리 구조에서 따오면 되겠죠.
각 글들은 자기 나름대로의 유일번호를 가지게 되니까 그것을 인덱스로
잡고...
자신의 Root(Main글)가 있는지 없으면 그건 일반 게시글이겠고 있다면
그것은 다른 글에 딸린 글이 되니까 답글이 되겠죠.
이 원리는 한번만 잡아놓으면 계속 연장해서 답글의 답글까지 갈 수도
있겠죠.
자세한것은 JSBoard소스를 보시면 나오겠지만...
간단한 DB구조는
Index, SubIndex, ...
이렇게 되겠죠?
여기서 먼저 SubIndex가 0(or -1)인 글을 찾고 각 Index를 가지는
SubIndex를
찾아 위치시키면... 원하는 모양이 나오겠죠.
SQL만 잘 손봐도 Sub Query를 사용하면 1번에 모두 왕창 불러올 수 있다고
하는데 안해봐서 모르겠네요.
그럼 성공 하시길... )
댓글 달기