我正在尝试将多行从数据库传递到客户端作为响应,但我无法实现!Error: {"src":null, "dest":null}
像这样,但是如果我尝试在它里面echo
的值打印列值但它没有通过。$s
这是我的代码:
$c=$db->getcount($dest);
$user = $db->getUserByEmailAndPassword($dest);
if ($user != false) {
$response["success"] = 1;
for($j=0;$j<=$c;$j++) {
$s= $user[$j]['src'];
$d =$user[$j]['dest'];
$response["user"]["src"] = $s;
$response["user"]["dest"] = $d;
}
echo json_encode($response);
}