num_rows > 0) { $id = 0; foreach ($serviceRes as $servicerow) { $id++; $services = array_merge($services, array(array($id, $servicerow['ServiceHistoryID'], $servicerow['AssetID'], $servicerow['isServiced'], $servicerow['InWard'], $servicerow['outWard'], $servicerow['ServiceHistoryCreatedAt'], $servicerow['ServiceHistoryUpdatedAt']))); } }