求MYSQL输出语句问题
我要输出最新新闻,,怎么才能输出最新的10条新闻?<?php$sql="select*fromnewsorderbynews_iddesc";$result=mysql_...
我要输出最新新闻,,怎么才能输出最新的10条新闻?
<?php
$sql="select * from news order by news_id desc";
$result=mysql_query($sql,$connect);
while($row=mysql_fetch_array($result)){
echo "<a class=a1 href=\"news_show.php?news_id=".$row["news_id"]."\">".$row["news_title"]."</a><br />";
}
?> 展开
<?php
$sql="select * from news order by news_id desc";
$result=mysql_query($sql,$connect);
while($row=mysql_fetch_array($result)){
echo "<a class=a1 href=\"news_show.php?news_id=".$row["news_id"]."\">".$row["news_title"]."</a><br />";
}
?> 展开
1个回答
2009-01-10
展开全部
$sql="select * from news order by news_id desc limit 0,10";
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询