我正在尝试在paypal付款后在mysql数据库中添加一些信息。 谢谢你的帮助:D
http://cl.ly/image/1b3T0z0Y0P3Y/Schermata%202014-01-04%20alle%2015.22.53.png
PAYPAL IPN CODE UP HERE
$receiver_email = $_POST['receiver_email'];
$payer_email = $_POST['payer_email'];
if (!$fp) {
// HTTP ERROR
} else {
fputs ($fp, $header . $req);
while (!feof($fp)) {
$res = fgets ($fp, 1024);
if (strcmp ($res, "VERIFIED") == 0) {
$con=mysqli_connect("123-123-123-123.compute-1.amazonaws.com","123","123","123");
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$sql="INSERT INTO `machines` (`m_a_id`, `m_enabled`, `m_hwid`, `m_name`, `m_expiry`, `m_times_accessed`, `m_last_accessed`, `m_notes`)
VALUES
(1, 1, '$memo', '$payer_email', '0', 2, '', '$item_name');;
if (!mysqli_query($con,$sql))
{
die('Error: ' . mysqli_error($con));
}
mysqli_close($con);
}
else if (strcmp ($res, "INVALID") == 0) {
// log for manual investigation
}
}
fclose ($fp);
}
?>
答案 0 :(得分:1)
此字符串:
$sql="INSERT INTO `machines` (`m_a_id`, `m_enabled`, `m_hwid`, `m_name`, `m_expiry`, `m_times_accessed`, `m_last_accessed`, `m_notes`)
VALUES
(1, 1, '$memo', '$payer_email', '0', 2, '', '$item_name');;
您已;;
,应更改为";