Advertisement
Guest User

Untitled

a guest
Oct 4th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. <?php
  2. $servername = "localhost";
  3. $username = "ogads_user";
  4. $password = "ogads_pass";
  5. $dbname = "ogads_db";
  6.  
  7. // Create connection
  8. $conn = new mysqli($servername, $username, $password, $dbname);
  9. // Check connection
  10. if ($conn->connect_error) {
  11. die("Connection failed: " . $conn->connect_error);
  12. }
  13.  
  14.  
  15. if(isset($_GET['offer_id']) && isset($_GET['offer_name']) && isset($_GET['payout']))
  16. {
  17.  
  18. $offer_id = $_GET['offer_id'];
  19. $offer_name = $_GET['offer_name'];
  20. $payout = $_GET['payout'];
  21.  
  22. $sql = "INSERT INTO records ('offer_id', 'offer_name', 'payout') VALUES ('$offer_id', '$offer_name', '$payout')";
  23.  
  24. if ($conn->query($sql) === TRUE) {
  25. echo "New record created successfully";
  26. } else {
  27. echo "Error: " . $sql . "<br>" . $conn->error;
  28. }
  29. }
  30. else
  31. {
  32. echo "Could not find get variables";
  33. }
  34.  
  35. $conn->close();
  36. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement