用PDO php更新mysql数据库 [英] updating mysql db with PDO php
本文介绍了用PDO php更新mysql数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以运行UPDATE sql来更新多行,就像我将数据插入多行一样?这是我的代码插入
is it possible to run an UPDATE sql to update multiple rows in the same way the i insert data into multiple rows? this is my code to insert
展开 | 选择 | Wrap | 行号
推荐答案
是。
例如,以下内容将更新所有具有user_id 3 的行。
Yes.
For instance, the following will update all rows that have the user_id 3.
展开 | 选择 | Wrap | Line数字
我已经尝试了尽可能多,我得到的是一个错误,说PDO发现它无效,当我使用单引号来改变它时,只需输入:数值进入数据库。
我是否必须完全按照你用反引号编写它?
i''ve tried as much and all i got was an error saying PDO finds it invalid and when i use single quotes for the values to change it just enters :value into the db.
do i have to do it exactly as you wrote it with the backquotes as well?
@anfetienne
你能告诉我你是怎么做的吗?
@anfetienne
Can you show me how you''re doing it?
这篇关于用PDO php更新mysql数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文