条件:现有表blog,其中有gidtitltype等字段gidtitledatecontentexcerptaliastypeviews12136K1393
条件:
现有表blog,其中有gid titl type 等字段
gid title date content excerpt alias type views
121
36K
1393
1
12
page
要求:
读表blog下type字段的值为blog中的所有内容。
这个sql只是读取所有的内容,其中type的值有两个,一个page,一个blog。我需要把type值为page的内容过滤掉,求大神给我改一下。
//5篇最新文章列表
function newlog(){
$db =
MySql::getInstance();
?>
$sql = "SELECT
gid,title,top,type,views,zcomnum,date FROM ".DB_PREFIX."blog ORDER BY `date`
DESC LIMIT 5";
$list = $db->query($sql);
while($row =
$db->fetch_array($list)){
?>
$row['title'];?>
?>
展开