<?php
include("conn/conn.php");
?>
<?php
$sql=mysql_query("select id,title from news order by date desc limit 1,12");
// $info=mysql_fetch_array($sql);
do{
?>
<a href="NewsShow.php?id=<?php echo $news_result_array[id];?>" target="_blank"><?php echo "·".substr($news_result_array[title],0,28);?></a><br/>
<?php
}
while($news_result_array=mysql_fetch_array($sql));
?>
include("conn/conn.php");
?>
<?php
$sql=mysql_query("select id,title from news order by date desc limit 1,12");
// $info=mysql_fetch_array($sql);
do{
?>
<a href="NewsShow.php?id=<?php echo $news_result_array[id];?>" target="_blank"><?php echo "·".substr($news_result_array[title],0,28);?></a><br/>
<?php
}
while($news_result_array=mysql_fetch_array($sql));
?>
$sql=mysql_query("select id,title from news order by date desc limit 1,12");
// $info=mysql_fetch_array($sql);
do{
?>
<a href="NewsShow.php?id= <?php echo $news_result_array[id];?>" target="_blank"> <?php echo "·".substr($news_result_array[title],0,28);?> </a> <br/>
<?php
}
while($news_result_array=mysql_fetch_array($sql));
?>
改成<?php
$sql=mysql_query("select id,title from news order by date desc limit 1,12");
// $info=mysql_fetch_array($sql);
while($news_result_array=mysql_fetch_array($sql)){
?>
<a href="NewsShow.php?id= <?php echo $news_result_array[id];?>" target="_blank"> <?php echo "·".substr($news_result_array[title],0,28);?> </a> <br/>
<?php
}
?>
1.数据库连接
2.sql语句
3.要显示的字段是否相对于数据库表的字段。
4.数据库表是否有数据。