i want to call from an array using the get array but it doesn't work what is the correct way to format this?
if(isset($_GET["category"])){
$cat = 'SELECT DISTINCT `Category` FROM `products`';
$result = $mysqli->query($cat);
$i='0';
while ($row = $result->fetch_array(MYSQLI_ASSOC)){
$i++;
$Category = $row["Category"];
$id = array($i => $Category);
}
$result->close();
$query = 'SELECT * FROM products WHERE Category="'. $id[$_GET["category"]]. '" ORDER BY Code';
}