我有 3 个表,我在 while 循环中查询了两个表和第二个表,这个表是结果视图中的问题,请检查附件以了解问题,这是 php 代码:
$select_all = mysql_query("SELECT categories.id,cat![enter image description here][1]egories.name,categories.name_en,
categories.block_type,group_fields.ct_id,group_fields.content,group_fields.content_en
FROM categories LEFT JOIN group_fields
ON categories.block_type=group_fields.id
WHERE categories.home_new='1' ORDER BY sorting ASC ")or die(mysql_error());
while($row_all = mysql_fetch_array($select_all))
{
$allcc[] = $row_all;
$tblname =$row_all['id'];
$select_grp = $Drweb2->mysql_query("select * from $tblname");
while($rrc = $Drweb2->mysql_fetch_array($select_grp))
{
$rgcont[] = $rrc;
}
$smarty->assign('data',$rgcont);
}
$smarty->assign('allcc',$allcc);
这是聪明的 html 代码:
{section name=gac loop=$allcc}
{$allcc[gac].content}
{/section}
问题示例:[1]:http: //i.stack.imgur.com/mOHIg.png