Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function database_write ($order_id, $status)
- {
- $servername = "localhost:8889";
- $username = "root";
- $password = "root";
- $dbname = "europroject";
- // Create connection
- $conn = mysqli_connect($servername, 'root', 'root', $dbname);
- // Check connection
- if ($conn->connect_error) {
- //TODO errormmessage aanpassen
- die("Connection failed: " . $conn->connect_error);
- }
- $order_id = intval($order_id);
- $stmt = $conn->prepare("INSERT INTO payments (ID, status) VALUES (?, ?)");
- $stmt->bind_param("is", $order_id, $status);
- $stmt->execute();
- //echo "New records created successfully";
- //$database = dirname(__FILE__) . "/orders/order-{$order_id}.txt";
- //file_put_contents($database, $status);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement