<?php
$con = new PDO('mysql:host=localhost;dbname=yourdb', 'root', '');
$stmt = $con->prepare('select * from product where price >= :min and price <= :max');
$stmt->bindValue('min', 5);
$stmt->bindValue('max', 10);
$stmt->execute();
while ($product = $stmt->fetch(PDO::FETCH_ASSOC)) {
echo 'id: ' . $product['id'] . '<br>';
echo 'name: ' . $product['name'] . '<br>';
echo 'price: ' . $product['price'] . '<br>';
echo '-------------------<br>';
}
?>