SHARE
TWEET

phpcode2

a guest Jun 17th, 2019 135 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. // EDIT: Your mysql database account information
  3. $username = "root";
  4. $password = "";
  5. $database = "rfid";
  6. $tablename = "test";
  7. $localhost = "localhost";
  8. // Check Connection to Database
  9. $db_connect = mysqli_connect($localhost, $username, $password, $database);
  10.  
  11. $request= $_GET['request'];
  12. $validation = mysqli_query($db_connect, "SELECT * FROM $tablename WHERE yourdata ='$request'");
  13.  if($validation->num_rows === 0){
  14.    $save = mysqli_query($db_connect, "INSERT INTO test (`yourdata`, `date`) VALUES ('$request', CURRENT_TIMESTAMP)");
  15.  }
  16. ?>
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