Php 这个问题出了什么问题?没有得到任何错误
第一次使用下一个查询时,我试图找出它的错误。foreach应该显示mysql数据库中的一些标题,但它没有显示任何内容。我也没有收到任何错误Php 这个问题出了什么问题?没有得到任何错误,php,mysql,foreach,doctrine,Php,Mysql,Foreach,Doctrine,第一次使用下一个查询时,我试图找出它的错误。foreach应该显示mysql数据库中的一些标题,但它没有显示任何内容。我也没有收到任何错误 <?php $industrey = Doctrine_Query::create()->from("Industry") ->select("id, title") ->where("title = ? ", 'title') ->
<?php
$industrey = Doctrine_Query::create()->from("Industry")
->select("id, title")
->where("title = ? ", 'title')
->addWhere("id = ?", 'id')
->orderBy("ord ASC")
->execute(array());
?>
<div class="block banners blockpromo">
<h2>Industries</h2>
<?php foreach ($industrey as $industry): ?>
<li><?php echo link_to($industry['title'].'<span></span>', '@industry?industry_alias='.$industry['id'], array('title' => $industry['title']));?></li>
<?php endforeach; ?>
</div>
行业
谢谢你的帮助。谢谢。订单不应该是1。从3中选择2。表中的“行业”在哪里。id、标题和ord是结构。非常确定这是正确的顺序。你能通过这个ORM发布生成的SQL查询吗?我不确定,但是应该选择not be->select('id','title')?你正在选择其中的id列等于字符串“id”,而title列等于字符串“title”,你的意思是在这里提供变量吗?此外,如果要选择表中的所有行业,则不需要这些where子句。is not order不应为1。select 2。from 3。where是表中的“行业”。id、标题和ord是结构。非常确定这是正确的顺序。你能通过这个ORM发布生成的SQL查询吗?我不确定,但是应该选择not be->select('id','title')?你正在选择其中的id列等于字符串“id”,而title列等于字符串“title”,你的意思是在这里提供变量吗?此外,如果要选择表中的所有行业,则不需要这些where子句。