전달받는 php에 직접 sql 조건을 입력시 정상적으로 작동하나
아래 폼에서 검색조건을 입력하고 Php에서 그 조건을 받아 작동시 결과값이 html에 나타나지 않고
php의 검색결과가 나타남.
|
|
|
|
|
|
|
|
php문
$conn=mysqli_connect(
'localhost',
'root',
'livestock01',
'milk');
$SQL = "select * from bidresult where supply_code={$_POST['supply_code']} and supply_year={$_POST['supply_year']}";
// form으로 입력 받지 않고 직접 조건시 성공 $SQL = "select * from bidresult where supply_code='5141434646' and supply_year='2019'";
$result = mysqli_query($conn, $SQL);
$ret_arr=array();
while($row=mysqli_fetch_array($result))
{
$filtered = array(
'result_id'=>htmlspecialchars($row['result_id']),
'school_name'=>htmlspecialchars($row['school_name']),
'school_city'=>htmlspecialchars($row['school_city']),
'school_gun'=>htmlspecialchars($row['school_gun']),
'bid_rank'=>htmlspecialchars($row['bid_rank'])
);
array_push($ret_arr, $filtered);
}
?>
{"data":
echo urldecode(json_encode($ret_arr));
?>}
----------------------------------------------------------------