从数据库中读取最新的十条新闻,实现新闻标题循环滚动,实在写不出来了,高手帮忙

解决方案 »

  1.   

    读十条,会吧???滚动的,g.cn 上多的是。。是个js+html而己
      

  2.   

    $query=mysql_query("select note_title from notice by note_date DESC limit 10");
    $result=mysql_query($sql);
    //搜索最近的10条的新闻。
    if(!$qaury){
    echo "没有通知..";
    }
    else
    {
    $rows=mysql_num_rows($query);
    $i=0;
    while($array=mysql_fetch_rows($query))
    { echo "array[$i]";
       $i++;
    }
    ?>
      

  3.   

    $sql="select note_title from notice by note_date DESC limit 10";
    $result=mysql_query($sql);
    /************************************/
    看样子lz不会程序
      

  4.   

    <!-- 用户最新相册 -->
    <!-- 首页最新照片开始 -->
    <div id="demo" style='text-align:top;overflow:hidden;height:90px;width:250px;'>
    <div id="demo1" valign="top"  style="text-align:top;">
    <a target='_blank' href='/show_photo.php?user=fanyanyiyun&id=100003611'><img src='http://cache44.51.com/photo5/9f/bf/fanyanyiyun/3bdda1b3a34176a9bea744a609e2c8fcs.jpg' border='1' style='height:100px;border-color:#cccccc'></a><br><a target='_blank' href='/show_photo.php?user=fanyanyiyun&id=100003610'><img src='http://cache44.51.com/photo5/9f/bf/fanyanyiyun/7119efa8472564fc342f5bb3b13e15f4s.jpg' border='1' style='height:100px;border-color:#cccccc'></a><br><a target='_blank' href='/show_photo.php?user=fanyanyiyun&id=100003608'><img src='http://cache44.51.com/photo5/9f/bf/fanyanyiyun/633ff5d5e05a339078d854fb1a0b5752s.jpg' border='1' style='height:100px;border-color:#cccccc'></a>
    </div>
    <div id="demo2" valign="top"  style="text-align:top;"></div>
    </div>
    <!-- 首页最新照片结束 --><script>
    var speed=30
    demo2.innerHTML=demo1.innerHTML;
    function Marquee(){
    if(demo2.offsetHeight-demo.scrollTop<=0)
    demo.scrollTop -= demo1.offsetHeight;
    else{
    demo.scrollTop++;
    }
    }
    var MyMar=setInterval(Marquee,speed);
    demo.onmouseover=function() {clearInterval(MyMar);}
    demo.onmouseout=function() {MyMar=setInterval(Marquee,speed);}
    </script>
      

  5.   


    $res=mysql_query("select note_title from notice order by note_date DESC limit 10");
    while($row=mysql_fetch_assoc($res))
       echo $row['note_title'];
      

  6.   

    $query=mysql_query("select note_title from `notice` by note_date DESC limit 10");
    //搜索最近的10条的新闻。
    if(!$query){
    echo "没有通知..";
    }
    else
    {
    $i=0;
    while($array=mysql_fetch_rows($query))
    { echo $array[$i];
      $i++;
    }
      

  7.   

    是order by 
    如果!$query发生了,是查询出错了
    查出了0条结果,也算查询成功
    mysql_num_rows()为0才算是没有通知