[前台调用]查询单页列表DYCMS
通用页面显示:
<?php
$sql="select id,title from about where enable=0 order by paixu asc,id asc limit 0,10";
$result=$conn->query($sql);
if($result->num_rows>0){
while($data=$...
通用页面显示:
<?php
$sql="select id,title from about where enable=0 order by paixu asc,id asc limit 0,10";
$result=$conn->query($sql);
if($result->num_rows>0){
while($data=$result->fetch_assoc()){
?>
<li<?php if($id==$data["id"]){echo ' class="on"';}?>>
<a href="about/show.php?id=<?php echo $data["id"]?>"><?php echo utf_substr($data["title"],20)?></a>
</li>
<?php
}
}
?>
单页显示:
<?php
$sql="select id,title from ".$tablename." where enable=0 order by paixu asc,id asc limit 0,10";
$result=$conn->query($sql);
if($result->num_rows>0){
while($data=$result->fetch_assoc()){
?>
<li<?php if($id==$data["id"]){echo ' class="on"';}?>>
<a href="?id=<?php echo $data["id"]?>"><?php echo utf_substr($data["title"],20)?></a>
</li>
<?php
}
}
?>
<?php
$sql="select id,title from about where enable=0 order by paixu asc,id asc limit 0,10";
$result=$conn->query($sql);
if($result->num_rows>0){
while($data=$result->fetch_assoc()){
?>
<li<?php if($id==$data["id"]){echo ' class="on"';}?>>
<a href="about/show.php?id=<?php echo $data["id"]?>"><?php echo utf_substr($data["title"],20)?></a>
</li>
<?php
}
}
?>
单页显示:
<?php
$sql="select id,title from ".$tablename." where enable=0 order by paixu asc,id asc limit 0,10";
$result=$conn->query($sql);
if($result->num_rows>0){
while($data=$result->fetch_assoc()){
?>
<li<?php if($id==$data["id"]){echo ' class="on"';}?>>
<a href="?id=<?php echo $data["id"]?>"><?php echo utf_substr($data["title"],20)?></a>
</li>
<?php
}
}
?>
上一篇:[后台开发]建立字段
下一篇:[插件]仿QQ商城幻灯代码
我要评论