<?php
require_once '/Users/anouluck/project_muanjai/muanjai/include/con_data.php';

try {
    $stmt = $pdo->query('SELECT id, product_code, products_name, price_1, price_2 FROM products LIMIT 5');
    $res = $stmt->fetchAll(PDO::FETCH_ASSOC);
    echo json_encode($res, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
} catch (Exception $e) {
    echo "Error: " . $e->getMessage();
}
?>