db에서 불러오는것좀 문의 드립니다. > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

db에서 불러오는것좀 문의 드립니다. 정보

db에서 불러오는것좀 문의 드립니다.

본문

option_array[0] = new Array("");
option_array[1] = new Array("- 세부상품을 선택하세요 -","test1","test1","test1");
option_array[2] = new Array("- 세부상품을 선택하세요 -","test2","test2");
option_array[3] = new Array("- 세부상품을 선택하세요 -","test3","test3");
option_array[4] = new Array("- 세부상품을 선택하세요 -","test4","test4");

상단은 셀렉터의 스크립트 옵션입니다.

test1,test2,test3... 이렇게 있는부분을 DB에서 불러와야 하는데요.. 숫자가 일정한게 아니고
array[1]이 5개가 될수도 있고 4개가 될수도 있습니다.
array[1]은 po_a 라는 테이블에서 it_num 1~15줄로 되어 있구요 필드명은 title입니다.
array[2]는 po_b 라는 테이블에서 똑같은 형식입니다.
똑같이 array[3] 은 po_c array[3]는 po_d 이구요...
어떤방식으로 어떻게 불러와야 할까요?


지금은 무식한 방법으로
$From  = " from po_a";
$i1=sql_fetch("select * $From where it_num='1'");
$i2=sql_fetch("select * $From where it_num='2'");
$i3=sql_fetch("select * $From where it_num='3'");
$i4=sql_fetch("select * $From where it_num='4'");
$i5=sql_fetch("select * $From where it_num='5'");
$i6=sql_fetch("select * $From where it_num='6'");
$i7=sql_fetch("select * $From where it_num='7'");
$i8=sql_fetch("select * $From where it_num='8'");
$i9=sql_fetch("select * $From where it_num='9'");
$i10=sql_fetch("select * $From where it_num='10'");
$i11=sql_fetch("select * $From where it_num='11'");
$i12=sql_fetch("select * $From where it_num='12'");
$i13=sql_fetch("select * $From where it_num='13'");
$i14=sql_fetch("select * $From where it_num='14'");
$i15=sql_fetch("select * $From where it_num='15'");

위의 소스를 사용중인데요..
저걸 간단하게 줄일수 있을까요? 저렇게 총 4개를 만들어서 불러오고 있거든요 ㅜㅜ

댓글 전체

전체 66,554 |RSS
그누4 질문답변 내용 검색

회원로그인

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