嘿伙计们(和女孩们)我遇到了数组问题,下面的代码看起来像是在复制数组中的每一列!:/
<?php
//quantidade_de_registro
include("mysqlconfig.inc");
$query = "SELECT * FROM contas ";
$res = mysql_query($query);
while($row = mysql_fetch_array($res)){
$arr[] = $row;
}
echo json_encode($arr);
mysql_close($con);
?>
它将返回如下内容:
[{"0":"5","ID":"5","1":"Zenny","Login":"Zenny","2":"Zeny","Nome":"Zeny","3":"daniel_queiroz789@hotmail.com","Email":"daniel_queiroz789@hotmail.com","4":"23021994","Senha":"23021994"}]
每列出现两次,但我需要每列只出现一次,我的一个朋友说我需要重新解析数组并将其放入数组中,我不知道这是什么意思或我该怎么做:/
请帮忙 :)