PayPal付款代码


Paypal payment code

php 中获取PayPal的金额、货币和交易 ID 的新代码是什么?我有这个代码。这是我在整个电子商务网站的制作过程中一直在观看的教程。

//payment details from paypal
        $amount = $_GET['amt'];
        $currency = $_GET['cc'];
        $trx_id = $_GET['tx']; //transaction

在这里,我将把上面的数据插入到这些变量中(带查询)。

//inserting payment to table
                $insert_payment= "insert into payments(amount,customer_id,product_id,trx_id,currency) values ('$amount','$c_id','$pro_id','$trx_id','$currency')";
                $run_payment = mysqli_query($con, $insert_payment);

结果,product_id只有数据。我该如何解决它?

如果你在MySQL查询中有一个php变量,那么你必须在查询中的变量之前和之后添加"."。

$insert_payment= "INSERT INTO payments (amount,customer_id,product_id,trx_id,currency) 
VALUES ('.$amount.','.$c_id.','.$pro_id.','.$trx_id.','.$currency.')";

立即尝试..