이걸 한번에 배열로 봅는 방법

이걸 한번에 배열로 봅는 방법

QA

이걸 한번에 배열로 봅는 방법

본문

$st=sql_fetch("select wr_content from g4_write_mb28 where wr_id='12' ");
$st3=sql_fetch("select wr_content from g4_write_mb28 where wr_id='13' ");
$st4=sql_fetch("select wr_content from g4_write_mb28 where wr_id='14' ");
$st5=sql_fetch("select wr_content from g4_write_mb28 where wr_id='15' ");
 
이런쿼리를 한번에 뽑아 배열로 담을 라면 어떤 쿼리를 쓰는게 맞을까요?
 
union ?
or?
 
 

이 질문에 댓글 쓰기 :

답변 2

select wr_content from g4_write_mb28 where wr_id BETWEEN 12 AND 15
 
select wr_content from g4_write_mb28 where wr_id>11 AND wr_id<16
 
 
 
 
무식한 방법으로 - 이건 띄엄띄엄 있을때 사용하고요.
select wr_content from g4_write_mb28 where wr_id=11 OR wr_id=12 OR wr_id=13 OR wr_id=14 OR wr_id=15
$sql_no = " select wr_content from g4_write_mb28 where wr_id BETWEEN 12 AND 15 ";
$qry = sql_query($sql_no);
while ($row = sql_fetch_array($qry)) {
 $noti[] = $row;
}
 
$noti[0][wr_content]
$noti[1][wr_content]
$noti[2][wr_content]
$noti[3][wr_content]
 
이렇게 해결했습니다.........감사드립니다 ^^ ㅎㅎ
 
답변을 작성하시기 전에 로그인 해주세요.
전체 1,200
QA 내용 검색

회원로그인

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