I am trying to concat several json key values so that I can return just a single value with all data. For example, In my code, I would like to combine address1, address2, address3 into Address. Is this possible. I have tried various methods of using the .= but nothing seems to work. Any heads up would be gratefully appreciated. Thanks
$query = "SELECT * FROM company_com";
$from = 0;
$to = 30;
$query .= " LIMIT ".$from.",".$to;
$result = mysql_query($query) or die("SQL Error 1: " . mysql_error());
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$customers[] = array(
'Address1' => $row['address1_com'],
'Address2' => $row['address2_com'],
'Address3' => $row['address3_com']
);
}
echo json_encode($customers);