<?php
include("include/connection.php");
$userid = $_POST['userid'];

$sql = mysqli_fetch_assoc(mysqli_query($con,"select * from tbl_gameid10 order by id desc limit 1"));
$periodid = $sql['gameid'] - 1 ;
$sqlu = mysqli_query($con,"select * from tbl_userresult10 where userid='$userid' and periodid='$periodid'");
$num = mysqli_num_rows($sqlu);
if($num > 0){
    $data= mysqli_fetch_assoc($sqlu);
    $status = $data['status'];
    if($status == 'success')
    {
     echo 'success';   
    }else{
      echo 'fail';  
    }
}else{
  echo '';  
}

?>