-1

检查该代码是否有任何错误?

<?php
$con=mysqli_connect("localhost","root","","mydb");
// Check connection
if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }    
$result = mysql_query("SELECT * FROM `mytable`");

    echo '<ul>';

    while (($row = mysql_fetch_assoc($result)) !== false) {

        $result= $row['name'];    

        echo '<li>';
        echo '<marquee behavior="scroll" direction="left">Name: '.$result.'</marquee>';
        echo '</li>';
}    
mysqli_close($con);
?>

我想在marquee中显示mysql字段数据, 请帮帮我。

4

1 回答 1

0

mysql_*两者mysqli_*都不相同。

全部更改mysql_*mysqli_*.

于 2013-09-21T09:23:20.610 回答