<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 查询?

        时间:2023-05-31

          <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 查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:在 Zend 2 框架应用程序中的请求 url 上找不到页面 下一篇:Zend Framework 表单、装饰器和验证:我应该回到纯 HTML 吗?

                  相关文章

                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>