<?php
$sql = "SELECT * FROM `notice` ORDER BY `time_at` DESC LIMIT 0,5";
mysql_query("SET NAMES UTF8");
$result = mysql_query($sql,$conn);
echo "<marquee direction='u'>"
while($row = @mysql_fetch_array($result))
{
$time_at = substr($row[time_at],0,10);
echo "<a href=\"notice.php?id=$row[id]\" rel=\"lyteframe[catalog]\" title=\"$row[title]\" rev=\"width: 600px; height: 500px; scrolling: no;\">$row[title]</a><br>";
}
echo "</marquee>"
?>//去这里看marquee的详解 http://hi.baidu.com/sky0014/blog/item/cf48f0dcf35de9a0cd1166b7.html

解决方案 »

  1.   

    上面的可行..要更好点,用JS实现..网上有教程..自己google.
      

  2.   

    谢谢,不过提示错误:Parse error: syntax error, unexpected T_WHILE, expecting ',' or ';' in D:\PHPnow\htdocs\index.php on line 106106行是:while($row = @mysql_fetch_array($result))
      

  3.   

    我也想用JS,但不知道怎么用在这段代码里,对PHP不太懂啊~~~
      

  4.   

    echo "<marquee direction='u'>" <--这里缺少行结束符';'