뮤

오류 구문인데요.. ㅠ 도저히 해결이 안되서..


//부모값에서 넘어온 변수
$se_01     = trim($se_01); //공백처리
$find_self = $se_01;
if (!$find_self)
  alert_close("Part No 를 입력하세요");
if(!get_magic_quotes_gpc()){
  $find_self  = addslashes($find_self);
  }
 
////////////////////////불러올 테이블 정보수정/////////////////////
//접속할 테이블 - 검색에서 불러올테이블명
$su[usertran]   = "";
$su[usertran]  .= "st-price-200704";  // 검색할 테이블명
$where_mct     = "";
$where_mct  .= " where PARTS NO  = '$find_self' ";  // 검색 조건값
//$where_mct  .= " where PARTS NO  like '%$find_self%'"; // 유사검색시 이용
//////////////////////////////////////////////////////////////////
// 자체 검색을 통화여 자료의 유무를 확인함
if ($find_self)
{
  
    //거래처명으로 조회시
    $su_sql          = " select * from `$su[usertran]`  $where_mct order by `PARTS NO`,`PARTS NAME` ";
   
    $su_result       = mysql_query($su_sql);
    $search_count    = 0;
    for ($i=0; $su_row = @mysql_fetch_array($su_result); $i++)
    {
        $list[$i][part_no]   = substr($su_row['PARTS NO'], 0, 30);
        $list[$i][part_name] = substr($su_row['PARTS NAME'], 0, 30);
        $search_count++;
    }
   
    $go_path[report]   = "";
    $go_path[report]   = $g4[path];
    $go_path[report]  .= "/skin/board/o_report/report_name1.php";
   
    if (!$search_count)
        alert_close("찾는 Part No가 존재하지 않습니다.");
}
 
 
----------------------------
 
$where_mct   을 주석처리하면 전체자료가 뿌려지는것으로 보아서 
 
$where_mct   여기가 문제인거 같은데요...
 
$where_mct  .= " where PARTS NO  = '$find_self' ";  // 검색 조건값
 
이 구문에 모가 잘못 된거죠.?   ㅠ 

댓글 3개

//접속할 테이블 - 검색에서 불러올테이블명
$su[usertran] = "";
$su[usertran] .= "st-price-200704"; // 검색할 테이블명
$where_mct = "";
$where_mct .= " and PARTS NO = '$find_self' "; // 검색 조건값
//$where_mct .= " and PARTS NO like '%$find_self%'"; // 유사검색시 이용




//거래처명으로 조회시
$su_sql = " select * from `$su[usertran]` where (1) $where_mct order by `PARTS NO`,`PARTS NAME` ";

식으로 해보세요......
아마도 where를 들었다가 놓는것에서 발생하지 않을까 합니다....

P.S : 디비 쿼리하면 자다가도 벌떡 일어나는 못난 TOGETHER......ㅠ.ㅠ(쿼리....무서버요...)
$where_mct .= " where PARTS NO = '$find_self' "; // 검색 조건값
를
$where_mct .= " where PARTS NO = `$find_self` "; // 검색 조건값
로...ㅡ_ㅡ;;;
$where_mct .= " where PARTS NO = '$find_self' "; // 검색 조건값
위에서 좌우에 공백이 있으니까

$su_sql = "select * from `$su[usertran]`{$where_mct}order by PARTS NO,PARTS NAME";
이렇게...
echo $su_sql; exit;
해보세요.
댓글을 작성하시려면 로그인이 필요합니다.

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

+
제목 글쓴이 날짜 조회
07-06-25 조회 1,711
07-06-25 조회 1,640
07-06-25 조회 1,649
07-06-25 조회 1,553
07-06-25 조회 1,550
07-06-25 조회 1,628
07-06-25 조회 1,612
07-06-25 조회 1,697
07-06-25 조회 1,765
07-06-25 조회 1,218
07-06-25 조회 1,624
07-06-24 조회 1,612
07-06-24 조회 1,643
07-06-24 조회 1,564
07-06-24 조회 1,611
07-06-24 조회 2,099
07-06-24 조회 1,512
07-06-24 조회 1,919
07-06-24 조회 1,618
07-06-24 조회 2,795