From 5cae92a624290490d5372655ccbd7a3482cfdd8d Mon Sep 17 00:00:00 2001 From: reliberate Date: Mon, 6 Jun 2016 16:57:11 -0600 Subject: [PATCH] Functions: Add function to retrieve countries array. --- resources/functions.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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