<?php

// Created by Abdullayev Olloyor Mo'sajon o'g'li on 08.02.2020

header('Content-type: text/html; charset=UTF-8');
require "connect.php";


$check = $_GET['check'];

$sql = "SELECT Id FROM savollar WHERE yuklandisi = '$check'";

mysqli_set_charset($conn,"utf8");

$result = mysqli_query($conn,"SET NAMES utf8");

$result = mysqli_query($conn, $sql);

$count=1;

if ($result !== false && $result->num_rows > 0) {

    while($row=mysqli_fetch_array($result)){

        $Id=$row['Id'];
        echo "".$Id;
        $count++;

    }
	if($count > 1){
		$conn->close();
		return;
	}
}
if($count == 1){
	echo "ok";
	$conn->close();
	return;
} else{
    echo "no";
	$conn->close();
	return;
}
$conn->close();
?>
