When I run the php file below it inserts data into mysql table twice. I don't run the insert command again anywhere, both entries have unique ids. Any ideas why?
Dumb of me Here it is:
<?php
require "conn.php";
require "stripe-php-4.4.0/init.php";
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$email = $_POST['email'];
$phonenum = $_POST['phonenum'];
$pin = $_POST['pin'];
$device = $_POST['device'];
$timeout = $_POST['timeout'];
$token = $_POST['stripeToken'];
// Set your secret key: remember to change this to your live secret key in production
// See your keys here: https://dashboard.stripe.com/account/apikeys
\Stripe\Stripe::setApiKey("secretkey");
// Create a Customer:
$customer = \Stripe\Customer::create(array(
"email" => $email,
"source" => $token,
));
// Save the customer ID and other info in a database for later.
$newCustID = $customer->id;
$insert_new_user = "INSERT INTO zeus_borrowers (fname,lname,email,phonenum,pin,stripecusid,timeout,device) VALUES ('$fname','$lname','$email','$phonenum','$pin','$newCustID','$timeout','$device')";
$result = mysqli_query($conn ,$insert_new_user);
if($conn->query($insert_new_user) === TRUE){
}
else{
echo "Error: " . $insert_new_user . "<br>" . $conn->error;
}
$conn->close();
?>