Print Array Elements Using Function With Sql