sql 쿼리문 3가지 문의합니다.

sql 쿼리문 3가지 문의합니다.

QA

sql 쿼리문 3가지 문의합니다.

본문

1. 내가 작성한 게시물

2. 내가 작성한 코멘트

3. 내 게시글에 달린 댓글 

 

위 3가지의 쿼리문 좀 알려주세요. 어떤 테이블에서 어떤 조건으로 뽑아야 하는지?

 

 

(예) 아래처림 생긴 구문 

$board = sql_fetch("select * from {$g4['board_table']} where bo_table = '{$bo_table}'"); 

 

 

 

이 질문에 댓글 쓰기 :

답변 1

1. select * from {$g4['board_table']} where bo_table = '{$bo_table}' and mb_id = '{$ss_mb_id}' and wr_is_comment =0

 

2. select * from {$g4['board_table']} where bo_table = '{$bo_table}' and mb_id = '{$ss_mb_id}' and wr_is_comment =1

 

 

3. select wr_id from {$g4['board_table']} where bo_table = '{$bo_table}' and mb_id = '{$ss_mb_id}' and wr_is_comment =0 자신의 글을 가져와서 wr_id 

   select * from {$g4['board_table']} where bo_table = '{$bo_table}' and wr_id = '{$wr_id}' and wr_is_comment =1

 

이렇게 하심 되지 싶은데 마지막껀 여러글이 있을수 잇으니 for 문 돌리신후 그아래 한번더 돌리시면 될것 같은데요

 

답변을 작성하시기 전에 로그인 해주세요.
전체 2,572
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT