0
我在我的应用程序中有一个页面不会显示所需的文本,因此我查看了我的Apache错误日志,并且发现了以下通知/错误。PHP未定义首页公告/错误
PHP Notice: Undefined index: PetManager_Model_Groomprocedures display.phtml on line 34
也正是由于这样的事实,我想显示从查询的结果,它似乎无法从我的结果数组获得此项目。 情况是我查询与服务表相关的预订表(这些元素显示正常),服务表又与程序表(这是不会显示的元素)相关。
有人可以告诉我我要去哪里错,即我的查询或我的显示代码,我怎样才能得到这个工作。
查询代码从我的显示屏操作
if ($input->isValid()) {
$q = Doctrine_Query::create()
->from('PetManager_Model_Kennelbooking k')
->leftJoin('k.PetManager_Model_Kennelservices s')
->leftJoin('s.PetManager_Model_Groomprocedures g')
->leftJoin('k.PetManager_Model_Clients c')
->leftJoin('k.PetManager_Model_Kennels l')
->where('k.kennelbookingID = ?', $input->id);
if('k.groomingIncluded'==1)
{$q->addWhere('s.groomingGiven=g.groomProceduresID');
}
$result = $q->fetchArray();
if (count($result) == 1) {
$this -> view -> booking = $result[0];
从我的PHTML文件
<td class="key">Grooming Procedure </td>
</tr>
<tr>
<?php if($this->booking['PetManager_Model_Kennelservices']['groomingGiven']==NULL)
echo '<td>'.'There is no grooming procedure associated for this booking'.'</td>';
else echo '<td>'.$this->escape($this->booking['PetManager_Model_Groomprocedures']['groomprocedure']).'</td>';
;?>
</tr>
提前许多感谢,
格雷厄姆
感谢您的回复,我的BB已经关闭,所以很抱歉让您迟到。我已经通过将display.phtml代码更改为其他内容来对此进行了排序。echo this''。$ this-> escape($ this-> booking ['PetManager_Model_Kennelservices'] ['PetManager_Model_Groomprocedures'] ['groomprocedure'])。'''; – Graham 2011-05-03 22:39:09