sql업구에 대해서여..휴~

// 분류
$ca_list = "";
$sql = " select * from $g4[yc4_category_table] ";
if ($is_admin != 'super')
$sql .= " where ca_mb_id = '$member[mb_id]' ";
$sql .= " order by ca_id ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{
$len = strlen($row[ca_id]) / 2 - 1;
$nbsp = "";
for ($i=0; $i<$len; $i++) {
$nbsp .= "   ";
}
$ca_list .= "<option value='$row[ca_id]'>$nbsp$row[ca_name]";
}
$ca_list .= "</select>";


$where = " and ";
$sql_search = "";
if ($stx != "") {
if ($sfl != "") {
$sql_search .= " $where $sfl like '%$stx%' ";
$where = " and ";
}
if ($save_stx != $stx)
$page = 1;
}

if ($sca != "") {
$sql_search .= " $where (a.ca_id like '$sca%' or a.ca_id2 like '$sca%' or a.ca_id3 like '$sca%') ";
}

if ($sfl == "") $sfl = "it_name";

$sql_common = " from $g4[yc4_item_table] a ,
$g4[yc4_category_table] b
where (a.ca_id = b.ca_id";
if ($is_admin != 'super')
$sql_common .= " and b.ca_mb_id = '$member[mb_id]'";
$sql_common .= ") ";
$sql_common .= $sql_search;

// 테이블의 전체 레코드수만 얻음
$sql = " select count(*) as cnt " . $sql_common;
$row = sql_fetch($sql);
$total_count = $row[cnt];

$rows = $config[cf_page_rows];
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
if ($page == "") { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $rows; // 시작 열을 구함

if (!$sst) {
$sst = "it_id";
$sod = "desc";
}
$sql_order = "order by $sst $sod";


$sql = " select *
$sql_common
$sql_order
limit $from_record, $rows ";
$result = sql_query($sql);

//$qstr = "$qstr&sca=$sca&page=$page";
$qstr = "$qstr&sca=$sca&page=$page&save_stx=$stx";
?>


여기서 sql업구에서...조건으로 로그인되여잇는 아이디로 검색해서 가져오려고하는데여..

아무리해도 안되네여,,쩝,,
|

댓글 1개

자세한 설명이 필요할거 같네요 ca_mb_id 필드에 해당 아이디로 검색하려고 하시는건가요?
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

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

+
제목 글쓴이 날짜 조회
15년 전 조회 1,261
15년 전 조회 985
15년 전 조회 1,545
15년 전 조회 1,142
15년 전 조회 1,564
15년 전 조회 977
15년 전 조회 1,710
15년 전 조회 1,610
15년 전 조회 1,131
15년 전 조회 1,546
15년 전 조회 1,667
15년 전 조회 1,550
15년 전 조회 1,736
15년 전 조회 1,546
15년 전 조회 1,412
15년 전 조회 1,619
15년 전 조회 1,544
15년 전 조회 1,557
15년 전 조회 1,033
15년 전 조회 1,720