<?php
require 'config.php';
require_login();

if(!isset($_GET['id'])) exit;

$id = (int)$_GET['id'];

$stmt = $pdo->prepare("SELECT price, order_text FROM subcategories WHERE id=? LIMIT 1");
$stmt->execute([$id]);
$sc = $stmt->fetch(PDO::FETCH_ASSOC);

if($sc){
    echo json_encode($sc);
}else{
    echo json_encode(['price'=>'','order_text'=>'']);
}
?>
