本地可以 上传到服务器以后 其中一个循环获取不到内容不能更新 是代码写的不对还是什么问题 查询的sql语句条件是order by id desc请大家帮帮忙
<ul><?php
include("conn.php");
$result=mysql_query("select * from new where type='shenghuo' order by id desc limit 0,1") or die("错误");
while($row1=mysql_fetch_array($result)){
?>

<li style="margin-top:-11px; cursor:pointer">
<div class="clearbox"><span class="lanmu bg1" style="padding-top:2px;">shenghuo</span><span class="ly"><a href="http://www.bj.xinhuanet.com/" title="">来自:<?php echo $row1[writer]?></a></span></div>
<div class="li_content"><a href="content.php?id=<?php echo $row1[id]?>" title=""><?php echo $row1[title]?></a></div>
</li>
<?php
}
?>

<?php
$resultpro=mysql_query("select * from new where type='shehui' order by id desc limit 0,1") or die("错误");
while($row2=mysql_fetch_array($resultpro)){
?>

<li>
<div class="clearbox"><span class="lanmu bg2" style="padding-top:2px;">shehui</span> <span class="ly"><a href="http://www.bj.xinhuanet.com/" title="">来自:<?php echo $row2[writer]?></a></span></div>
<div class="li_content"><a href="content.php?id=<?php echo $row2[id]?>" title=""><?php echo $row2[title]?></a></div>
</li>
<?php
}
?>

<?php
$resultty=mysql_query("select * from new where type='tiyu' order by id desc limit 0,1") or die("错误");
while($row3=mysql_fetch_array($resultty)){
?>

<li>
<div class="clearbox"><span class="lanmu bg3" style="padding-top:2px;">tiyu</span> <span class="ly"><a href="http://www.bj.xinhuanet.com/" title="">来自:<?php echo $row3[writer]?></a></span></div>
<div class="li_content"><a href="content.php?id=<?php echo $row3[id]?>" title=""><?php echo $row3[title]?></a></div>
</li>
<?php
}
?>

<?php
$resultwy=mysql_query("select * from new where type='wenyu' order by id desc limit 0,1") or die("错误");
while($row4=mysql_fetch_array($resultwy)){
?>

<li>
<div class="clearbox"><span class="lanmu bg4" style="padding-top:2px;">wenyu</span> <span class="ly"><a href="http://www.bj.xinhuanet.com/" title="">来自:<?php echo $row4[writer]?></a></span></div>
<div class="li_content"><a href="content.php?id=<?php echo $row4[id]?>" title=""><?php echo $row4[title]?></a></div>
</li>
<?php
}
?>

<?php
$resultjy=mysql_query("select * from new where type='jingyun' order by id desc limit 0,1") or die("错误");
while($row5=mysql_fetch_array($resultjy)){
?>

 <li>
<div class="clearbox"><span class="lanmu bg5" style="padding-top:1px;">jingyun</span> <span class="ly"><a href="http://www.bj.xinhuanet.com/" title="">来自:<?php echo $row5[writer]?></a></span></div>
<div class="li_content"><a href="content.php?id=<?php echo $row5[id]?>" title=""><?php echo $row5[title]?></a></div>
</li>
<?php
}
?>

<?php
$resultwh=mysql_query("select * from new where type='wenhua' order by id desc limit 0,1") or die("错误");
while($row6=mysql_fetch_array($resultwh)){
?>

<li>
<div class="clearbox"><span class="lanmu bg6" style="padding-top:1px;">wenhua</span> <span class="ly"><a href="http://www.bj.xinhuanet.com/" title="">来自:<?php echo $row6[writer]?></a></span></div>
<div class="li_content"><a href="content.php?id=<?php echo $row6[id]?>" title=""><?php echo $row6[title]?></a></div>
</li>
<?php
}
?>


</ul>

解决方案 »

  1.   

    页面上有6个while循环 6个类型 添加相应类型内容更新的时候有一个类型内容更新不了 页面上显示不出来
      

  2.   

    第二个循环 
    <?php
    $resultpro=mysql_query("select * from new where type='shehui' order by id desc limit 0,1") or die("错误");
    while($row2=mysql_fetch_array($resultpro)){
    ?>
    <li>
    <div class="clearbox"><span class="lanmu bg2" style="padding-top:2px;">shehui</span> <span class="ly"><a href="http://www.bj.xinhuanet.com/" title="">来自:<?php echo $row2[writer]?></a></span></div>
    <div class="li_content"><a href="content.php?id=<?php echo $row2[id]?>" title=""><?php echo $row2[title]?></a></div>
    </li>
    <?php
    }
    ?>
    显示不出来
      

  3.   

    那就是没有符合  type='shehui' 条件的记录啰
      

  4.   

    在页面中 echo mysql_fetch_array($resultpro)  看看 如果是1 你再去循环体里找原因
      

  5.   

    到PHPMYADMIN或其他数据库工具中执行你的SQL语句:"select * from new where type='shehui' order by id desc limit 0,1",看看有没有结果