$sql = "select name from movies order by id desc limit 0,10";
$get = mysql_query($sql);
$resul = mysql_fetch_array($get);
for($x = 0;$x <10;$x++)
{
$sql = "select id from movies where name = '$resul[$x]'";
$got = mysql_query($sql);
$result = mysql_fetch_array($got);
echo "<script>alert('$x'+'$resul[$x]')</script>";
echo "<p><a href='watch.php?id=$result[0]'>$resul[$x]</a></p>";
}
这样子在数据库里明明有两条,但是只输出了最后的一条,后面的都是空白
qq_笑_17