<?php
include 'connect.php';
if(!isset($_GET['category_id'])){
echo"No Id";
}
else{
$category_id=$_GET['category_id'];
$sql="SELECT *FROM a_items WHERE CategoryID_FK=$category_id AND ItemShow_status=1";
$result=mysqli_query($con,$sql);
if($result){
    $temparray=array();
    while($row=mysqli_fetch_assoc($result)){
        $temparray[]=[
            'item_id'=>$row['ItemID'],
            'item_desc'=>$row['ItemDescription'],
            'description'=>$row['ItemName'],
            'image'=>$row['ItemImage'],
            'show_status'=>$row['ItemShow_status'],
            'out_status'=>$row['ItemOutOfStock_status'],
            ];
    }
    echo json_encode($temparray);
    mysqli_free_result($result);
    mysqli_close($con);
}
else{
   echo mysqli_error($con);
}
}
?>