Guest User

Untitled

a guest
Feb 27th, 2018
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. <?php
  2. $servername = "localhost";
  3. $username = "vagrant;"; // uvagrant is for mysql -uvagrant (meaning user/vagrant)
  4. $password = "vagrant";
  5. $dbname = "fastpic";
  6.  
  7. // Create connection
  8. $conn = new mysqli($servername, $username, $password, $dbname);
  9.  
  10. // Check connection
  11. if ($conn->connect_error) {
  12. die("Connection failed: " . $conn->connect_error);
  13. }
  14. echo "Connected successfully";
  15.  
  16. $sql = "INSERT INTO follow (leader_user_id, follower_user_id, follow_id, timestamp_id, created_date, modified_date) VALUES (value1, value2, value3, ...)";
  17. if ($conn->query($sql) === TRUE) {
  18. echo "New record created successfully";
  19. } else {
  20. echo "Error: " . $sql . "<br>" . $conn->error;
  21. }
  22.  
  23. $conn->close();
  24. ?>
Add Comment
Please, Sign In to add comment