Company: '; } else { $html = ' Company: '; if($table == "suppliers") { $results = common_ref_client::get_all_suppliers(); if(is_array($results)) { $html .= ''; } } else if($table == "clients") { $results = common_ref_client::get_all_clients(); if(is_array($results)) { $html .= ''; } } $html .= ' '; } } $results = array("html" => $html); $json = json_encode($results); echo $json;