I am running the following code to query two tables, the json loaded with duplicate values with different strings. could you please help me tackle this issue.
Code.php
$acctname = $_REQUEST['acctname'];
$items = mysql_query("SELECT * FROM account_items WHERE acctname = '$acctname'")or die(mysql_error());
while ($rows = mysql_fetch_array($items)) {
$itemType = $rows['item_type'];
$itemid = $rows['id'];
$Qitems_cat = mysql_query("SELECT * FROM `$itemType` WHERE ".$itemType.'_'."id = '$itemid' ")or die(mysql_error());
$array = array();
while ($result = mysql_fetch_array($Qitems_cat)) {
echo json_encode($array);
}
}
Result.json note the "0" is the same as "network_id" and so on.
{"network_id":"16","acctname":"Test","networkname":"networkOne","networkIP":null}{"Server_id":"2","acctname":"Test","servername":"test server"}