Created
July 13, 2018 15:51
-
-
Save hackerrahul/159a02782fece68b31e6177055a30033 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$servername = "localhost"; | |
$username = "username"; | |
$password = "password"; | |
$dbname = "myDB"; | |
// Create connection | |
$conn = new mysqli($servername, $username, $password, $dbname); | |
// Check connection | |
if ($conn->connect_error) { | |
die("Connection failed: " . $conn->connect_error); | |
} | |
$payment_id = $response['payments'][0]['payment_id']; | |
$buyer_name = $response['payments'][0]['buyer_name']; | |
$buyer_email = $response['payments'][0]['buyer_email']; | |
$purpose = $response['purpose']; | |
$payment_status = $response['status']; | |
$payment_amount = $response['amount']; | |
$query = mysqli_query($conn,"INSERT INTO TABLE_NAME (payment_id,buyer_name,buyer_email,purpose,payment_status,payment_amount) | |
VALUES('$payment_id','$buyer_name','$buyer_email','$purpose','$payment_status','$payment_amount')"); | |
if ($query) { | |
echo "Data Inserted"; | |
} else { | |
echo "Error: " . $sql . "<br>" . mysqli_error($conn); | |
} | |
mysqli_close($conn); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment