SHARE
TWEET

Untitled

a guest Jul 17th, 2019 93 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3.      include 'includes/db.php';
  4.      
  5.      // Check whether username or password is set from android 
  6.      if(isset($_POST['qrcode']))
  7.      {
  8.         // Innitialize Variable
  9.         $result='';
  10.         $qrcode = $_POST['qrcode'];
  11.         //$qrcode = 'WC376J';
  12.         $currentdate=date("Y-m-d");
  13.         // Query database for row exist or not
  14.         $sql = 'SELECT bookingid from bookings where qrcodetext=:qrcode and booked_date=:currentdate';
  15.         $stmt = $conn->prepare($sql);
  16.         $stmt->bindParam(':qrcode', $qrcode, PDO::PARAM_STR);
  17.         $stmt->bindParam(':currentdate', $currentdate, PDO::PARAM_STR);
  18.         $stmt->execute();
  19.         if($stmt->rowCount())
  20.         {
  21.             $result="true";
  22.         }  
  23.         elseif(!$stmt->rowCount())
  24.         {
  25.             $result="false";
  26.         }
  27.  
  28.         echo $result;
  29.     }
  30.    
  31. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top