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

  • <tfoot id='oSgtq'></tfoot>
  • <small id='oSgtq'></small><noframes id='oSgtq'>

      <i id='oSgtq'><tr id='oSgtq'><dt id='oSgtq'><q id='oSgtq'><span id='oSgtq'><b id='oSgtq'><form id='oSgtq'><ins id='oSgtq'></ins><ul id='oSgtq'></ul><sub id='oSgtq'></sub></form><legend id='oSgtq'></legend><bdo id='oSgtq'><pre id='oSgtq'><center id='oSgtq'></center></pre></bdo></b><th id='oSgtq'></th></span></q></dt></tr></i><div id='oSgtq'><tfoot id='oSgtq'></tfoot><dl id='oSgtq'><fieldset id='oSgtq'></fieldset></dl></div>
      1. 为视图表推进自定义 sql

        Propel custom sql for view tables(为视图表推进自定义 sql)
          <tbody id='6WsBg'></tbody>
          <bdo id='6WsBg'></bdo><ul id='6WsBg'></ul>

            <legend id='6WsBg'><style id='6WsBg'><dir id='6WsBg'><q id='6WsBg'></q></dir></style></legend>
            1. <small id='6WsBg'></small><noframes id='6WsBg'>

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

                  <tfoot id='6WsBg'></tfoot>
                  本文介绍了为视图表推进自定义 sql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  由于某些原因,propel 没有为视图表生成模型,如果您使用 reverse 任务,它甚至不包含视图表的结构.所以我别无选择,只能使用自定义查询.如果模型存在,我知道该怎么做:

                  For some reason propel is not generating model for view tables, it doesn't even include the structure of the view table if you use the reverse task. So I have no option but to use a custom query. That I know how to do if the model exists:

                  <?php 
                      $con = Propel::getConnection(BookPeer::DATABASE_NAME);
                      $sql = "complicated query here...";
                      $stmt = $con->prepare($sql);
                      $stmt->execute();
                  

                  但是由于 propel 没有为我的视图表生成模型,我不知道该怎么做.我试过了,但没有用

                  but since propel does not generate a model for my view table, i don't know how to do that. I've tried this but it doesn't work

                  <?php 
                      $con = Propel::getConnection(MyViewTable::DATABASE_NAME);
                      $sql = "SELECT * FROM MyViewTable";
                      $stmt = $con->prepare($sql);
                      $stmt->execute();
                  

                  我真的需要这份工作.请帮忙:)

                  I really need to have this work. Please help :)

                  推荐答案

                  $con = Propel::getConnection();
                  

                  您将获得当前的数据库连接,您可以进行任何您喜欢的 sql 查询,

                  You will get your current database connection and you can make any sql query you like,

                  这篇关于为视图表推进自定义 sql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  What does SQL clause quot;GROUP BY 1quot; mean?(SQL 子句“GROUP BY 1是什么意思?意思是?)
                  MySQL groupwise MAX() returns unexpected results(MySQL groupwise MAX() 返回意外结果)
                  MySQL SELECT most frequent by group(MySQL SELECT 按组最频繁)
                  Why Mysql#39;s Group By and Oracle#39;s Group by behaviours are different(为什么 Mysql 的 Group By 和 Oracle 的 Group by 行为不同)
                  MySQL GROUP BY DateTime +/- 3 seconds(MySQL GROUP BY DateTime +/- 3 秒)
                  MySQL cumulative sum grouped by date(按日期分组的 MySQL 累计总和)
                    <tbody id='ptpWZ'></tbody>
                  • <bdo id='ptpWZ'></bdo><ul id='ptpWZ'></ul>
                  • <i id='ptpWZ'><tr id='ptpWZ'><dt id='ptpWZ'><q id='ptpWZ'><span id='ptpWZ'><b id='ptpWZ'><form id='ptpWZ'><ins id='ptpWZ'></ins><ul id='ptpWZ'></ul><sub id='ptpWZ'></sub></form><legend id='ptpWZ'></legend><bdo id='ptpWZ'><pre id='ptpWZ'><center id='ptpWZ'></center></pre></bdo></b><th id='ptpWZ'></th></span></q></dt></tr></i><div id='ptpWZ'><tfoot id='ptpWZ'></tfoot><dl id='ptpWZ'><fieldset id='ptpWZ'></fieldset></dl></div>

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

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