我有个疑问。为什么我们不能将 mysql_fetch_row 的元素存储在一个数组中,然后在后面的代码中使用呢?
例如,这串代码给出了意外的等待时间错误。
$result=mysql_query($query) or die(mysql_error());
$n=mysql_num_rows($result);
$a=array();
$a[$i]=array();
for ($i=o; $i<$n; $i++)
{
$r=mysql_fetch_row($result);
$a[$i][0]=$r[0];
$a[$i][1]=$r[1];
}
echo $a[0][1];
echo $a[0][0];