<legend id='UOYxG'><style id='UOYxG'><dir id='UOYxG'><q id='UOYxG'></q></dir></style></legend>

  • <tfoot id='UOYxG'></tfoot>

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

    • <bdo id='UOYxG'></bdo><ul id='UOYxG'></ul>

      <i id='UOYxG'><tr id='UOYxG'><dt id='UOYxG'><q id='UOYxG'><span id='UOYxG'><b id='UOYxG'><form id='UOYxG'><ins id='UOYxG'></ins><ul id='UOYxG'></ul><sub id='UOYxG'></sub></form><legend id='UOYxG'></legend><bdo id='UOYxG'><pre id='UOYxG'><center id='UOYxG'></center></pre></bdo></b><th id='UOYxG'></th></span></q></dt></tr></i><div id='UOYxG'><tfoot id='UOYxG'></tfoot><dl id='UOYxG'><fieldset id='UOYxG'></fieldset></dl></div>
      1. 如何在 zend 框架中打印精确的 sql 查询?

        How to print exact sql query in zend framework ?(如何在 zend 框架中打印精确的 sql 查询?)

          <bdo id='NSgDt'></bdo><ul id='NSgDt'></ul>
        • <legend id='NSgDt'><style id='NSgDt'><dir id='NSgDt'><q id='NSgDt'></q></dir></style></legend>

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

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

                <tbody id='NSgDt'></tbody>

              <tfoot id='NSgDt'></tfoot>
                  本文介绍了如何在 zend 框架中打印精确的 sql 查询?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我从模型中提取了以下代码,

                  I have the following piece of code which i taken from model,

                      ...
                                    $select = $this->_db->select()
                                      ->from($this->_name)
                                      ->where('shipping=?',$type)
                                      ->where('customer_id=?',$userid);
                                   echo  $select; exit; // which gives exact mysql query.
                              .....
                  

                  当我在 zend 中使用更新查询时,

                  When i use update query in zend like ,

                  $up_value = array('billing'=> '0');
                  $this->update($up_value,'customer_id ='.$userid.' and address_id <> '.$data['address_Id']);      
                  

                  在这里我想知道确切的 mysql 查询.有没有办法在 zend 中打印 mysql 查询?善意的建议

                  Here i want to know the exact mysql query. Is there any possible way to print the mysql query in zend ? kindly advice

                  推荐答案

                  选择对象在 Zend Framework 中具有 __toString() 方法.

                  Select objects have a __toString() method in Zend Framework.

                  来自 Zend 框架手册:

                  From the Zend Framework manual:

                  $select = $db->select()
                               ->from('products');
                  
                  $sql = $select->__toString();
                  echo "$sql
                  ";
                  
                  // The output is the string:
                  //   SELECT * FROM "products"
                  

                  另一种解决方案是使用 Zend_Db_Profiler.即

                  An alternative solution would be to use the Zend_Db_Profiler. i.e.

                  $db->getProfiler()->setEnabled(true);
                  
                  // your code
                  $this->update($up_value,'customer_id ='.$userid.' and address_id <> '.$data['address_Id']); 
                  
                  Zend_Debug::dump($db->getProfiler()->getLastQueryProfile()->getQuery());
                  Zend_Debug::dump($db->getProfiler()->getLastQueryProfile()->getQueryParams());
                  $db->getProfiler()->setEnabled(false);
                  

                  http://framework.zend.com/manual/en/zend.db.select.html

                  这篇关于如何在 zend 框架中打印精确的 sql 查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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 的问题)
                1. <legend id='XbVkA'><style id='XbVkA'><dir id='XbVkA'><q id='XbVkA'></q></dir></style></legend>
                2. <i id='XbVkA'><tr id='XbVkA'><dt id='XbVkA'><q id='XbVkA'><span id='XbVkA'><b id='XbVkA'><form id='XbVkA'><ins id='XbVkA'></ins><ul id='XbVkA'></ul><sub id='XbVkA'></sub></form><legend id='XbVkA'></legend><bdo id='XbVkA'><pre id='XbVkA'><center id='XbVkA'></center></pre></bdo></b><th id='XbVkA'></th></span></q></dt></tr></i><div id='XbVkA'><tfoot id='XbVkA'></tfoot><dl id='XbVkA'><fieldset id='XbVkA'></fieldset></dl></div>

                        1. <small id='XbVkA'></small><noframes id='XbVkA'>

                        2. <tfoot id='XbVkA'></tfoot>
                            <bdo id='XbVkA'></bdo><ul id='XbVkA'></ul>
                              <tbody id='XbVkA'></tbody>