gpt4 book ai didi

php - Paypal IPN 脚本/MySql 插入查询问题

转载 作者:太空宇宙 更新时间:2023-11-03 11:07:43 26 4
gpt4 key购买 nike

我的 IPN 脚本有问题。它可以用于验证付款等,但我试图让它将数据输入数据库。之前的用户电子邮件和密码输入工作正常但不是第二个..

$item_name = $_POST['item_name'];
$item_number = $_POST['item_number'];
$payment_status = $_POST['payment_status'];
$payment_amount = $_POST['mc_gross'];
$payment_currency = $_POST['mc_currency'];
$txn_id = $_POST['txn_id'];
$receiver_email = $_POST['receiver_email'];
$payer_email = $_POST['payer_email'];

$email = $_POST['item_name'];
$password = mt_rand(1000, 9999);
$Random = print_r($_POST);


mysql_query("INSERT INTO users (email, password) VALUES('". mysql_escape_string($email) ."', '".md5($password)."') ") or die(mysql_error());

mysql_query("INSERT INTO LNCH_Sales SET
item_name = '%s',
item_number = '%s',
payment_status = '%s',
payment_amount = '%s',
payment_currency = '%s',
txn_id = '%s',
receiver_email = '%s',
payer_email = '%s'",
mysql_real_escape_string($item['name']),
mysql_real_escape_string($item['number']),
mysql_real_escape_string($payment['status']),
mysql_real_escape_string($payment['amount']),
mysql_real_escape_string($payment['currency']),
mysql_real_escape_string($txn['id']),
mysql_real_escape_string($receiver['email']),
mysql_real_escape_string($payer['email'])

);

知道这里出了什么问题吗?

最佳答案

您的语法错误 - 而不是

INSERT INTO LNCH_SALES SET

(看起来像是 INSERT 和 UPDATE 的混合体),你需要

INSERT INTO LNCH_SALES(<column_list>) VALUES (...

关于php - Paypal IPN 脚本/MySql 插入查询问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10737319/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com