我想从mysql加载数据
数据库连接:(database_cnn.php)
编辑:
include 'database_cnn';
$query= "select * from all_songs";
$res= mysql_query($query);
$result= array();
while ($row = mysql_fatch_array($res))
array_push($result , array( 'id' => row[0],
'title' => row[1],
'artist' => row[2] ,
'album' =>row[3],
'lyric' =>row[4]
)
);
echo json_encode(array( "result" => $result));
?>
我得到的错误:
Parse error: syntax error, unexpected '[', expecting ')' in D:\xampp\htdocs\abc\IPA_3rd\database_out.php on line 13
谁能告诉我为什么会出现这个错误?我的代码有问题吗?