使用DB_DataObject PHP进行更新 [英] Update using DB_DataObject PHP

查看:86
本文介绍了使用DB_DataObject PHP进行更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在PHP中使用DB_DataObject和mySQL db。



$ dbDataObject-> Name = $ newName;

$ dbDataObject-> whereAdd();

$ dbDataObject-> whereAdd(''id =''。$ id);

$ dbDataObject-> update();




以上查询呈现为

更新表集名称=''$ newName''其中​​name =''$ newName''和ID = $ id;

而不是

更新表格集名称=''$ newName''其中​​ID = $ id;



预先感谢您的回答。



谢谢,

Sai。

Hi,
I am using DB_DataObject in PHP with mySQL db.

$dbDataObject->Name=$newName;
$dbDataObject->whereAdd();
$dbDataObject->whereAdd(''id=''.$id);
$dbDataObject->update();


The above query is rendered as
"update table set name =''$newName'' where name=''$newName'' and ID=$id;"
instead of
"update table set name =''$newName'' where ID=$id;"

Thanks in advance for the answer.

Thanks,
Sai.

推荐答案

dbDataObject-> Name =
dbDataObject->Name=


newName;
newName;


dbDataObject-> whereAdd();
dbDataObject->whereAdd();


这篇关于使用DB_DataObject PHP进行更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆