自动编辑php表

时间:2017-08-19 18:48:43

标签: php mysql phpmyadmin

我在phpMyAdmin中有一个硬币表,我需要它在用户通过PayPal完成购买时自动更新。它的设置方式是PayPal会自动将它们重定向到我选择的链接。

那么,我如何运行一个从URL中获取参数的脚本并将新记录添加到表中?

感谢您的帮助。

2 个答案:

答案 0 :(得分:0)

因此,链接需要是一个名为payment_success.php

的页面

在该页面上,您需要有一个如下所示的脚本:

<?php
include 'credentials.php'; /*this is a file that will contain your database connection info

Then here you will establish the connection and enter the data into the desired table*/

$var1 = 'some information collected from paypal that you want to update';
$id = 'some identifiable information about your user that can connect them to the correct row in your table';

I won't hold your hand through all this but the SQL query you would need would be:

UPDATE table_name SET column_1 = '$var1' WHERE ID = '$id'

答案 1 :(得分:0)

设置确认PayPal链接以增加特定用户的MySQL表中的硬币数量值.... !!!

我希望这会有用.....如果我能了解你的桌子或更多信息,我可以给你一个明确的想法。