PHP code
$qBasicRslt = mysqli_query($conn , $qBasic) or die(mysqli_error($conn));
$json_array[] = array();
while($row = mysqli_fetch_array($qBasicRslt))
{
$json_array[] = $row;
}
echo json_encode($json_array);
SQL query_
SELECT `user`.`passwrd` AS Pass, `user`.`status` AS status,
`useraccounts`.`Balance` AS bal, `useraccounts`.`AccountID` AS AccID,
`accounts`.`AccountNo` AS Accno
FROM `user`
LEFT JOIN `useraccounts` ON `user`.`email` = `useraccounts`.`email`
LEFT JOIN `accounts` ON `accounts`.`AccountID` = `useraccounts`.`AccountID`
WHERE user.email = 'abc@testmail.com'
this is how my data is coming data on console.log is this [[],{"0":"12345","Pass":"12345","1":"active","status":"active","2":"0.260000000","bal":"0.260000000","3":"3","AccID":"3","4":"1LKHakRqzYi6K7sSDHmV3FirMUpN9YNMYQ","Accno":"1LKHakRqzYi6K7sSDHmV3FirMUpN9YNMYQ"}]
jquery code
success: function(data) {
for (var i=0; i<data.length; i++) {
var row = $('<tr><td>' + data[i].Pass+ '</td><td>' + data[i].status + '</td><td>' + data[i].bal +'</td><td>' + data[i].Accno +'</td><td>' + data[i].AccID + '</td></tr>');
$('#wallet').append(row);
}
instead of displaying json_encoded data this function is displaying undefined in the table.and var row contains [object][object]