使用准备好的语句进行UPDATE查询 [英] UPDATE query with prepared statements
本文介绍了使用准备好的语句进行UPDATE查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
遇到问题并不断更新查询
Having problems with and update query i keep getting
Warning: Crud::update() [crud.update]: Property access is not allowed yet in crud.php on line 60
这是我的代码
$stmt = $this->mysql->prepare('UPDATE links SET title = ?, url = ?, comment = ? WHERE id = ?');
$stmt->bind_param('sssi',$title,$url,$comment,$id);
$stmt->execute();
$stmt->close();
on line 60 return $stmt->affected_rows;
Googled它,在注释中仅在php文档中找到一个参考,但我听不懂该注释:
Googled it and only found one reference in the php documentation in a comment but i couldn't understand the comment :/
推荐答案
问题是我真的在使用$stmt->affected_rows;
傻错误之前使用了$stmt->close();
.这就是我深夜编码的结果.
The problem was that I used $stmt->close();
before using $stmt->affected_rows;
silly error really. That's what I get for late night coding.
这篇关于使用准备好的语句进行UPDATE查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文