<bdo id='lY8rv'></bdo><ul id='lY8rv'></ul>

      <small id='lY8rv'></small><noframes id='lY8rv'>

      1. <tfoot id='lY8rv'></tfoot>

        <legend id='lY8rv'><style id='lY8rv'><dir id='lY8rv'><q id='lY8rv'></q></dir></style></legend>
      2. <i id='lY8rv'><tr id='lY8rv'><dt id='lY8rv'><q id='lY8rv'><span id='lY8rv'><b id='lY8rv'><form id='lY8rv'><ins id='lY8rv'></ins><ul id='lY8rv'></ul><sub id='lY8rv'></sub></form><legend id='lY8rv'></legend><bdo id='lY8rv'><pre id='lY8rv'><center id='lY8rv'></center></pre></bdo></b><th id='lY8rv'></th></span></q></dt></tr></i><div id='lY8rv'><tfoot id='lY8rv'></tfoot><dl id='lY8rv'><fieldset id='lY8rv'></fieldset></dl></div>

        学说 dbal 查询构建器作为准备好的语句

        doctrine dbal querybuilder as prepared statement(学说 dbal 查询构建器作为准备好的语句)
          <bdo id='oG7aZ'></bdo><ul id='oG7aZ'></ul>

          <small id='oG7aZ'></small><noframes id='oG7aZ'>

              <tbody id='oG7aZ'></tbody>
              • <i id='oG7aZ'><tr id='oG7aZ'><dt id='oG7aZ'><q id='oG7aZ'><span id='oG7aZ'><b id='oG7aZ'><form id='oG7aZ'><ins id='oG7aZ'></ins><ul id='oG7aZ'></ul><sub id='oG7aZ'></sub></form><legend id='oG7aZ'></legend><bdo id='oG7aZ'><pre id='oG7aZ'><center id='oG7aZ'></center></pre></bdo></b><th id='oG7aZ'></th></span></q></dt></tr></i><div id='oG7aZ'><tfoot id='oG7aZ'></tfoot><dl id='oG7aZ'><fieldset id='oG7aZ'></fieldset></dl></div>

              • <legend id='oG7aZ'><style id='oG7aZ'><dir id='oG7aZ'><q id='oG7aZ'></q></dir></style></legend>
                <tfoot id='oG7aZ'></tfoot>

                1. 本文介绍了学说 dbal 查询构建器作为准备好的语句的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试创建一个 Doctrine DBAL 查询构建器对象并在其中设置一个参数.(使用 postgres db,dbal 2.3.4,学说

                  I'm trying to create a Doctrine DBAL querybuilder object and setting a parameter in it. (using a postgres db, dbal 2.3.4, doctrine

                  $connection = $this->_em->getConnection();
                  $qb = $connection->createQueryBuilder();
                  $qb->select('tbl_user_contract.pkid AS pkid');
                  $qb->from('tbl_user_contract', 'tbl_user_contract');
                  $qb->join('tbl_user_contract', 'tbl_user', 'tbl_user', 'tbl_user_contract.fk_user = tbl_user.pkid');
                  $qb->where('tbl_user.pkid = :userid');
                  $qb->setParameter(':userid', 10);
                  

                  当我尝试获取此 querybuilder 对象的结果时,出现以下错误:

                  When I try to get the results of this querybuilder object I get the following error:

                  SQLSTATE[08P01]: <<Unknown error>>: 7 ERROR: bind message supplies 0 parameters, 
                  but prepared statement "pdo_stmt_00000002" requires 1
                  

                  当我检查 postgres 日志时,我看到查询通过,我注意到它需要一个参数,但我不会得到传入的参数.

                  When I check the postgres logs, I see the query passing by and I notice that it expects a parameter, but I won't get a parameter passed in.

                  我尝试在 where 表达式本身中设置 id(不使用准备好的语句),这奏效了.但我真的很想通过准备好的语句来实现这一点.

                  I tried to set the id in the where expression itself (without using prepared statements), that worked. But I really want to get this working with prepared statements.

                  有人知道如何解决这个问题吗?

                  Anyone knows how to solve this?

                  提前致谢

                  推荐答案

                  我认为你只需要从 setparameter 命令中删除冒号

                  I think you just need to remove colon from setparameter command

                  $qb->setParameter('userid', 10);
                  

                  至少它适用于 Doctrine help https://www.doctrine-project.org/projects/doctrine-dbal/en/2.9/reference/query-builder.html

                  At least it works in Doctrine help https://www.doctrine-project.org/projects/doctrine-dbal/en/2.9/reference/query-builder.html

                  这篇关于学说 dbal 查询构建器作为准备好的语句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                    <bdo id='6yhSI'></bdo><ul id='6yhSI'></ul>
                  • <small id='6yhSI'></small><noframes id='6yhSI'>

                  • <tfoot id='6yhSI'></tfoot>
                        <tbody id='6yhSI'></tbody>

                      • <i id='6yhSI'><tr id='6yhSI'><dt id='6yhSI'><q id='6yhSI'><span id='6yhSI'><b id='6yhSI'><form id='6yhSI'><ins id='6yhSI'></ins><ul id='6yhSI'></ul><sub id='6yhSI'></sub></form><legend id='6yhSI'></legend><bdo id='6yhSI'><pre id='6yhSI'><center id='6yhSI'></center></pre></bdo></b><th id='6yhSI'></th></span></q></dt></tr></i><div id='6yhSI'><tfoot id='6yhSI'></tfoot><dl id='6yhSI'><fieldset id='6yhSI'></fieldset></dl></div>

                          <legend id='6yhSI'><style id='6yhSI'><dir id='6yhSI'><q id='6yhSI'></q></dir></style></legend>