Advertisement
Guest User

Untitled

a guest
Sep 17th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. function database_write ($order_id, $status)
  2. {
  3. $servername = "localhost:8889";
  4. $username = "root";
  5. $password = "root";
  6. $dbname = "europroject";
  7. // Create connection
  8. $conn = mysqli_connect($servername, 'root', 'root', $dbname);
  9. // Check connection
  10. if ($conn->connect_error) {
  11. //TODO errormmessage aanpassen
  12. die("Connection failed: " . $conn->connect_error);
  13. }
  14.  
  15.  
  16.  
  17. $order_id = intval($order_id);
  18.  
  19.  
  20.  
  21. $stmt = $conn->prepare("INSERT INTO payments (ID, status) VALUES (?, ?)");
  22. $stmt->bind_param("is", $order_id, $status);
  23.  
  24.  
  25. $stmt->execute();
  26. //echo "New records created successfully";
  27. //$database = dirname(__FILE__) . "/orders/order-{$order_id}.txt";
  28.  
  29. //file_put_contents($database, $status);
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement