这个 zend update 语句的流程是什么

发布于 2024-11-01 03:22:17 字数 353 浏览 1 评论 0原文

我知道这个语句更新了zend框架中的记录。但我想了解这句话的完整流程。声明是

$request->update($data,$request->getAdapter()->quoteInto('id = ?',$this->getRequest()->getParam('selected_id'))) )
$data is the array of records that is passed to it and $request is the object of model. I want to know whole meaning of this statement

I know that this statement updates the record in the zend framework. But I want to understand the complete flow of this statement. Statement is

$request->update($data,$request->getAdapter()->quoteInto('id = ?',$this->getRequest()->getParam('selected_id'))) )

$data is the array of records that is passed to it and $request is the object of model. I want to know whole meaning of this statement

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

嗼ふ静 2024-11-08 03:22:17

如您所知,更新语句使用 $table->update($data, $where);

$request 是数据库表模型。 ->getAdapter 获取 适配器

另外 quoteInto() 最好由文档定义

引用最典型的用法是将 PHP 变量插入 SQL 表达式或语句中。您可以使用 quoteInto() 方法一步完成此操作。此方法有两个参数:第一个参数是包含占位符 (?) 的字符串,第二个参数是应替换该占位符的值或 PHP 变量。

最后一个表达式$this->getRequest()->getParam('selected_id')

$this->getRequest() 获取请求 $_GET 类型

getParam('selected_id')) 获取 selected_idGET 对象的 code>。

As you know update statement uses $table->update($data, $where);

$request is db table model. ->getAdapter gets the adapter.

Also quoteInto() is best defined as by documentation

The most typical usage of quoting is to interpolate a PHP variable into a SQL expression or statement. You can use the quoteInto() method to do this in one step. This method takes two arguments: the first argument is a string containing a placeholder symbol (?), and the second argument is a value or PHP variable that should be substituted for that placeholder.

And the last expression $this->getRequest()->getParam('selected_id').

$this->getRequest() gets the request $_GET type

And getParam('selected_id')) fetches selected_id of GET object.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文