if(isset($_POST['price']) AND isset($_POST['product'])){
// http://www.php.su/mysqli_fetch_assoc - тут соединение с базой
$result_json = array();
//пример с ссылки
$mysqli = new mysqli("localhost", "my_user", "my_password", "world");
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
$query = "SELECT Name, CountryCode FROM City ORDER by ID DESC LIMIT 50,5";
if ($result = $mysqli->query($query)) {
/* fetch associative array */
while ($row = $result->fetch_assoc()) {
$result_json[] = $row["Name"]." ".$row["CountryCode"];
}
/* free result set */
$result->close();
}
/* close connection */
$mysqli->close();
echo json_encode($result_json);
exit();
}