Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. <?php
  2. $db = mysqli_connect("localhost", "john_john", "6Rt3Tsz79v", "john_john");
  3. if(!$db)
  4. {
  5. exit("Fail: ".mysqli_connect_error());
  6. }
  7.  
  8. $sql = "INSERT INTO 24_api (username, email, password)
  9. VALUES ('John', 'Doe', 'john@example.com')";
  10.  
  11. if ($conn->query($sql) === TRUE) {
  12. echo "New record created successfully";
  13. } else {
  14. echo "Error: " . $sql . "<br>" . $conn->error;
  15. }
  16.  
  17. $conn->close();
  18.  
  19. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement