아래 구문이 한줄 한줄 어떤 의미인지 설명 좀 해주세요 !

아래 구문이 한줄 한줄 어떤 의미인지 설명 좀 해주세요 !

QA

아래 구문이 한줄 한줄 어떤 의미인지 설명 좀 해주세요 !

답변 1

본문

$list = array();
$idx = 0;
$rowspan = array();
$sql = "select * from $g4[group_table] where gr_use_not = '' and gr_only_admin = '' order by gr_order, gr_id";
$qry = sql_query($sql);
while ($row = sql_fetch_array($qry)) {
    $rowspan[$row[gr_id]] = 0;
    $sql2 = "select * from $mw[menu_middle_table] where gr_id = '$row[gr_id]' and mm_only_admin = '' order by mm_order, mm_id";
    $qry2 = sql_query($sql2);
    while ($row2 = sql_fetch_array($qry2)) {
$sql3 = "select * from $mw[menu_small_table] where mm_id = '$row2[mm_id]' and bo_table <> '' and ms_only_admin = '' order by ms_order, ms_id";
$qry3 = sql_query($sql3);
while ($row3 = sql_fetch_array($qry3)) {
    $sql4 = "select * from $g4[board_table] where bo_table = '$row3[bo_table]' ";
    $row4 = sql_fetch($sql4);
    if ($row4[bo_read_level] >= 10 && $row4[bo_write_level] >= 10 &&$row4[bo_comment_level] >= 10 && $row4[bo_download_level] >= 10) continue;
    $list[$idx] = $row4; 
    $list[$idx][href] = "$g4[bbs_path]/board.php?bo_table=$row4[bo_table]";
    $list[$idx][gr_id] = $row[gr_id];
    $list[$idx][gr_subject] = $row[gr_subject];
    $list[$idx][ms_name] = $row3[ms_name];
    //if ($row4[bo_read_level] == 1) $list[$idx][bo_read_point] = 0;
    //if ($row4[bo_download_level] == 1) $list[$idx][bo_download_point] = 0;
    //if ($row4[bo_write_level] == 1) $list[$idx][bo_write_point] = 0;
    //if ($row4[bo_comment_level] == 1) $list[$idx][bo_comment_point] = 0;
    $idx++;
    $rowspan[$row[gr_id]] += 1;
}
    }
}
$total_count = sizeof($list);


소스 보는 문이 까막눈이다 보니...꼭 이런 부분에서 막히네요. 
ps. 위와 같은 구문을 읽을 줄 알려면 어떤 걸 공부해야 하는지..

이 질문에 댓글 쓰기 :

답변 1

한줄 한줄 설명드리긴 어렵구요

그냥 DB에서 질의한다음에 질의 내용에 조건에 따라서  루프(반복) 구문을 실행하도록 되어 있는겁니다.

아래 강좌인데 공부하시면 될듯합니다.

https://www.linux.co.kr/php/



책방가셔서 php 초급 책 보셔두 되구요
답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 25
© SIRSOFT
현재 페이지 제일 처음으로