我对 PHP 使用 MySQL 很陌生,我需要了解余额系统(虚拟货币)以使我的网站正常运行,所以首先我让插入货币系统工作:
/* MySQL Begin */
$_CONFIG['mysql']['dbhost'] = 'localhost';
$_CONFIG['mysql']['dbuser'] = '********';
$_CONFIG['mysql']['dbpw'] = '*******';
$_CONFIG['mysql']['dbname'] = 'user';
$_CONFIG['mysql']['tbname'] = 'member';
$_CONFIG['mysql']['field_username'] = 'username';
$_CONFIG['TMN']['point_field_name'] = 'balance';
/* Amount received after topup */
$_CONFIG['TMN'][50]['point'] = 50;
$_CONFIG['TMN'][90]['point'] = 90;
$_CONFIG['TMN'][150]['point'] = 150;
$_CONFIG['TMN'][300]['point'] = 300;
$_CONFIG['TMN'][500]['point'] = 500;
$_CONFIG['TMN'][1000]['point'] = 1000;
/* Connecting the topup service */
define('API_PASSKEY', 'NSTPasskey01');
现在,我需要制作一个商店系统,这意味着它涉及检查用户余额,如果余额足够,它会触发减法函数,从一定数量中减去用户余额并运行命令。我在这部分需要帮助,有人有什么好的方法吗?