<?php
$host = 'localhost'; // или другой хост
$dbname = 'k123263_price';
$username = 'k123263_price_us';
$password = '2024Brs!2024';

try {
    $conn = new PDO("mysql:host=$host;dbname=$dbname", $username, $password);
    echo "<label for='product'>Producto:</label>";
    echo "<select id='product' name='product_id'>";

    foreach ($conn->query('SELECT id, name, base_price FROM products') as $row) {
        echo "<option value='".$row['id']."'>".$row['name']." - $".$row['base_price']."</option>";
    }

    echo "</select>";
    echo "<label for='quantity'>Cantidad:</label>";
    echo "<input type='number' id='quantity' name='quantity' value='1' min='1'>";
    
} catch(PDOException $e) {
    echo "Connection failed: " . $e->getMessage();
}
?>
