SHARE
TWEET

Untitled

a guest Jun 17th, 2019 112 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 = "arduino01";
  4. $password = "123456789";
  5. $database = "rfid";
  6. $tablename = "test";
  7. $localhost = "localhost";
  8. // Check Connection to Database
  9. $db_connect = mysqli_connect($localhost, $username, $password);
  10. $db_select = mysqli_select_db($db_connect, $database);
  11.  
  12. $request= $_GET['request'];
  13. $validation = mysqli_query($db_connect, "SELECT * FROM $tablename WHERE yourdata ='$request'");
  14.  if(mysqli_num_rows($validation) === 0){
  15.     $sql = "INSERT INTO $tablename(Data) VALUES ($request)";
  16.     mysqli_query($db_connect, $sql);
  17.  }
  18. ?>
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