php - How to use comaprision in this case -
if(isset($_post["request"])){
$email = $_post['email']; $p_name = $_post['p_name']; $noc = $_post['noc']; $year = $_post['year']; $get_email = "select email book email = '$email' "; $run_email = mysqli_query($con,$get_email); $check = mysqli_num_rows($run_email); if($check==1){ echo "<script>alert('you have booked') </script>"; exit(); } $get_name = "select capacity party type_party='$p_name' "; $run_name = mysqli_query($con,$get_name); $checkk = $run_name > '$noc'; if(checkk){ echo "<script>alert('out of bound') </script>"; exit(); }
how compare capacity party table value of $noc?? please me out. thank you!
you have missed $
in last condition.
<?php $email = $_post['email']; $p_name = $_post['p_name']; $noc = $_post['noc']; $year = $_post['year']; $get_email = "select email book email = '$email' "; $run_email = mysqli_query($con,$get_email); $check = mysqli_num_rows($run_email); if($check==1){ echo "<script>alert('you have booked') </script>"; exit(); } $get_name = "select capacity party type_party='$p_name' "; $run_name = mysqli_query($con,$get_name); $checkname = mysqli_num_rows($run_name ); //$checkk = $run_name > '$noc'; if($checkname > $noc){ echo "<script>alert('out of bound') </script>"; exit(); } ?>
Comments
Post a Comment