<?php
include 'connect.php'; // Include your database connection script

if (isset($_GET['itemId'])) {
  $itemId = $_GET['itemId'];
  $specifications = array();

  // Replace this query with your SQL query to fetch specifications for the given item
  $sql = "SELECT * FROM a_specifications WHERE itemID_FK = $itemId";
  $result = mysqli_query($con, $sql);

  while ($row = mysqli_fetch_assoc($result)) {
    $specifications[] = $row;
  }

  // Return the specifications as JSON
  echo json_encode($specifications);
} else {
  echo "Invalid request.";
}
