I want to update my database with an SQL statement once someone clicks a button on the website. I've tried something, no success. Can you guys help me ? Here's the code:
http://pastebin.com/D0S83Jgh
Don't know if I made this question correctly, I'm new here.
用于更新MySQL列的按钮不起作用
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
2条回答 默认 最新
- dongmibeng5885 2015-12-29 16:51关注
Your prepared statement is wrong.
The code I use with pdo to do a query is this:
$sqlUpd = $upd->prepare("UPDATE league_signups SET approved='1' WHERE id = :id"); $q->bindParam(':id', $id, PDO::PARAM_STR); $q->execute();
Should work like a charm.
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报