我遇到了一个问题
$divider_div = ($last_topic % 2 == 0) ? '
<div class="clear"></div>' : FALSE ;
应该在每秒钟发生一次之后放置,但它会以某种方式中断序列。
我做错了什么?
任何建议都非常受欢迎
这是我的脚本
$category_topic_query = 'SELECT l.category_name, l.category_folder, l.category_page, f.parentpageID, f.ImagePath, f.referring_url, f.templateTitle FROM lcategories l INNER JOIN Files f ON f.parentpageID = l.ID WHERE f.pageID = "0" ORDER BY f.parentpageID';
$resc = $db->prepare($category_topic_query);
$resc->execute();
$last_topic = NULL;
while ($category_topic = $resc -> fetch()){
$category_topic_ID = $category_topic['parentpageID'];
if($category_topic_ID !== $last_topic) {
$category_topic_name = str_replace("&", "&", $category_topic['category_name']);
$category_topic_url = DST.$category_topic['category_folder'].DS.$category_topic['category_page'];
$divider_div = ($last_topic % 2 == 0) ? '
<div class="clear"></div>' : FALSE ;
$first_ul = ($category_topic_ID == 1) ? FALSE : '</ul>
</div>'.$divider_div ;
print<<<END
$first_ul
<div style="float: left; margin: 10px; width: 349px;">
<h2 class="h_unln"><a href="$category_topic_url">$category_topic_name</a></h2>
<ul class="arrow">
END;
$last_topic = $category_topic_ID;
}
$links_array = ($category_topic['referring_url'] == NULL) ? FALSE :'<li><a href="'.DST.$category_topic['ImagePath'].DS.$category_topic['referring_url'].'">'.$category_topic['templateTitle'].'</a></li>';
print<<<END
$links_array
END;
}
print<<<END
</ul>
</div>
<div class="clear"></div>
END;
提前致谢