diff --git a/resources/functions.php b/resources/functions.php index 1331c877b3..e8ac82d7b3 100644 --- a/resources/functions.php +++ b/resources/functions.php @@ -1943,4 +1943,17 @@ function number_pad($number,$n) { } } +//retrieve array of countries + if (!function_exists('get_countries')) { + function get_countries($db) { + $sql = "select * from v_countries order by country asc"; + $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement->execute(); + $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); + $result_count = count($result); + return ($result_count > 0) ? $result : false; + unset ($prep_statement, $sql); + } + } + ?> \ No newline at end of file