1,"insert"=>2,"update"=>3,"delete"=>4); $show = FALSE; function start_connect() { $con = oci_connect(USER,PASS,DB); return $con; } function end_connect($con) { oci_close($con); } function make_sql($cate,$highlows,$item,$maker,$serial,$price) { $category = array("", "item_deji", "item_kaden","item_pc", "item_ofice", "item_cdvd"); $hg = array("<=",">="); $fr = FALSE; if ($cate == 0) { $table_all = TRUE; $table = "TB"; }else{ $table = $category[$cate]; } $sql = "select * from ".$table; if ($item != NULL){ $fr = TRUE; $item = str_replace(' ',' ',$item); $buf = ereg_replace('[[:space:]]',"%' OR ITEM_NAME LIKE '%",$item); $sql = $sql." where "."ITEM_NAME LIKE '%".$buf."%' "; } if ($maker != NULL) { if ($fr) { $sql = $sql." AND "; } else { $fr = TRUE; $sql = $sql." where "; } $maker = str_replace(' ',' ',$maker); $buf = ereg_replace('[[:space:]]',"%' OR ITEM_MAKER LIKE '%",$maker); $sql = $sql." ITEM_MAKER LIKE '%".$buf."%' "; } if ($serial != NULL) { if ($fr) { $sql = $sql." AND "; } else { $fr = TRUE; $sql = $sql." where "; } $serial = str_replace(' ',' ',$serial); $buf = ereg_replace('[[:space:]]',"' OR ITEM_NUMBER = '",$serial); $sql = $sql."ITEM_NUMBER = '".$buf."' "; } if ($price != NULL) { if ($fr) { $sql = $sql." AND "; } else { $fr = TRUE; $sql = $sql." where "; } $price = str_replace(' ',' ',$price); $buf = ereg_replace('[[:space:]]'," OR ITEM_PRICE $hg[$highlows] ",$price); $sql = $sql."ITEM_PRICE ".$hg[$highlows]." ".$buf." "; } if ($table_all) { for ($i=1;$i