<?php
include 'connect.php';
if(!isset($_GET['item_id'])){
echo"No Id";
}
else{
$item_id=$_GET['item_id'];
$sql = "SELECT a_items.ItemID, a_items.ItemName, S.* FROM a_specifications S INNER JOIN a_items ON S.ItemID_FK = a_items.ItemID WHERE a_items.ItemID = $item_id";
$result=mysqli_query($con,$sql);
if($result){
    $temparray=array();
    while($row=mysqli_fetch_assoc($result)){
        $temparray[]=[
            'item_id'=>$row['ItemID'],
            'item_name'=>$row['ItemName'],
            'specification_id'=>$row['SpecificationID'],
            'description'=>$row['S_description'],
            'price'=>$row['S_price'],
            'quantity'=>$row['S_quantity'],
            'image'=>$row['S_Image'],
            'status'=>$row['S_Status'],
            ];
    }
    echo json_encode($temparray);
    mysqli_free_result($result);
    mysqli_close($con);
}
else{
   echo mysqli_error($con);
}
}
?>