Php JSON输出包括索引号

Php JSON输出包括索引号,php,mysql,json,Php,Mysql,Json,我试图用php创建一个JSON输出,当我输出结果时,我得到了数据库中没有的数字 以下是我的php代码: 0、1、2、3从何而来?将$row=mysql\u fetch\u数组($result)替换为$row=mysql\u fetch\u assoc($result) mysql\u fetch\u array()也返回数组,该数组给出了这些0、1、2、3个索引尝试使用mysql\u fetch\u assoc($result)mysql\u fetch\u array()既有数字标识,也有关

我试图用php创建一个JSON输出,当我输出结果时,我得到了数据库中没有的数字

以下是我的php代码:


0、1、2、3从何而来?

$row=mysql\u fetch\u数组($result)
替换为
$row=mysql\u fetch\u assoc($result)


mysql\u fetch\u array()也返回数组,该数组给出了这些0、1、2、3个索引

尝试使用
mysql\u fetch\u assoc($result)
mysql\u fetch\u array()
既有数字标识,也有关联标识。它也应该来自您的数据库……工作得很好。非常感谢!
<?php 
mysql_select_db("mark1", $link);

$result = mysql_query("SELECT * FROM `Movies` LIMIT 0, 30 ");

while($row = mysql_fetch_array($result))
{
  $output[]=$row;
}
print(json_encode($output));
?>
[{"0":"58","id":"58","1":"test","title":"test","2":"test","actors":"test","3":"G","rating":"G"}]