欢迎访问 舍力博客(www.shuyong.net)
$DB=MySql::getInstance(); $sql=$DB->query("SELECT * FROM ".DB_PREFIX."comment WHERE gid='5' AND hide='n' LIMIT 30"); while($row=$DB->fetch_array($sql)){$get[]=$row;} foreach($get as $row){echo $row['cid'].'<br />';}把这行代码随意加到header上面试试去,至于变量修改那你就根据需要自己改吧,具体参数参考数据库结构。其中地方gid表示id,LIMIT 30中的30表示条数
<?php function duli_pl(){ $DB=MySql::getInstance(); $sql=$DB->query("SELECT * FROM ".DB_PREFIX."comment WHERE gid='2' AND hide='n' LIMIT 1000"); while($row=$DB->fetch_array($sql)){$get[]=$row;} foreach($get as $row){echo '<a href="'.$row['url'].'" target="_blank" title="'.$row['poster'].'" >'.$row['poster'].'</a>';} }?>
<?php
function duli_pl(){
$DB=MySql::getInstance();
$sql=$DB->query("SELECT * FROM ".DB_PREFIX."comment WHERE gid='2' AND hide='n' AND mail!='345952779@qq.com' LIMIT 1000");
while($row=$DB->fetch_array($sql)){$get[]=$row;}?>
<div class="pl">
<?php foreach($get as $row){?>
<ul><li>
<img src="<?php echo myGravatar($row['mail']); ?>" align="left" />
<div class="pl-tt"><a href="<?php echo $row['url']; ?>" target="_blank" target="<?php echo $row['poster']; ?>"><?php echo $row['poster']; ?></a></div>
<div class="pl-nr"><?php echo $row['comment']; ?></div>
</li></ul>
<?php }?></div>
<?php }?>
留言/评论:◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。