PHP如何把前端用户的增删改查操做记录写进数据库表?
展开全部
做个日志记录表 每次增删改查后 更新表 如
//记录
$sql = "insert into `h_log_point2` set ";
$sql .= "h_userName = '" . $rss['h_buyUserName'] . "', ";
$sql .= "h_price = '" . $num . "', ";
$sql .= "h_type = '交易完成', ";
$sql .= "h_about = '交易ID:" . $id . "', ";
$sql .= "h_addTime = '" . date('Y-m-d H:i:s') . "', ";
$sql .= "h_actIP = '" . getUserIP() . "' ";
$db->query($sql);
echo '修改成功';
//记录
$sql = "insert into `h_log_point2` set ";
$sql .= "h_userName = '" . $rss['h_buyUserName'] . "', ";
$sql .= "h_price = '" . $num . "', ";
$sql .= "h_type = '交易完成', ";
$sql .= "h_about = '交易ID:" . $id . "', ";
$sql .= "h_addTime = '" . date('Y-m-d H:i:s') . "', ";
$sql .= "h_actIP = '" . getUserIP() . "' ";
$db->query($sql);
echo '修改成功';
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询