<?php

// Created by Abdullayev  on 10.02.2020
header('Content-type: text/html; charset=UTF-8');
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    if ($_POST['user_id']!="" && $_POST['sorov_id']!="" ) {
 require "connect.php";


$umum_soni = 0;

$user_id = $_POST['user_id'];
$sorov_id = $_POST['sorov_id'];
$count=1;

$sql_sorov = "SELECT Id,javob FROM javoblar WHERE user_id = '$user_id' AND sorov_id = '$sorov_id'";

mysqli_set_charset($conn,"utf8");
$javob = mysqli_query($conn,"SET NAMES utf8");
$javob = mysqli_query($conn, $sql_sorov);


if ($javob !== false && $javob->num_rows > 0) {
    while($row=mysqli_fetch_array($javob)){

    	$Id=$row['Id'];
		$javob2=$row['javob'];
		$javob2 = str_replace('"', '`', $javob2);
		if($javob2 == ""){
		    echo "0";
		} else {
		    echo $javob2;
		}
		$conn->close();
		return;
    }
}
else

echo 'no';

}else{
    echo 'no_enough_info';
}
}

?>
