Title: Callback with database
Last modified: September 1, 2019

---

# Callback with database

 *  Resolved [Leoned](https://wordpress.org/support/users/leo9412/)
 * (@leo9412)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/callback-with-datanase/)
 * Hello! i’m using the callback funtion in some of my fields, with this example
   [Callback](https://docs.ultimatemember.com/article/1486-how-to-use-choices-callback),
   works fine, but i need to fill a big amount of choices.
 * there’s a way to fill the array with a database query instead of a SWITCH?, i
   searched how to do it, but it doesn’t works, i’m noob in PHP, if someone knows
   to do this i’d appreciate it. Thanks!
    -  This topic was modified 6 years, 9 months ago by [Leoned](https://wordpress.org/support/users/leo9412/).

Viewing 1 replies (of 1 total)

 *  Plugin Support [mansurahamed](https://wordpress.org/support/users/mansurahamed/)
 * (@mansurahamed)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/callback-with-datanase/#post-11889850)
 * Hi [@leo9412](https://wordpress.org/support/users/leo9412/),
 * You must check the value of choice with either switch or if/else statement to
   match your requirement. You can use any query which return array inside switch
   or if/else statement. If you need help with any wordpress query, please provide
   more description.
 * Thanks.

Viewing 1 replies (of 1 total)

The topic ‘Callback with database’ is closed to new replies.

 * ![](https://ps.w.org/ultimate-member/assets/icon-256x256.png?rev=3160947)
 * [Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin](https://wordpress.org/plugins/ultimate-member/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ultimate-member/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ultimate-member/)
 * [Active Topics](https://wordpress.org/support/plugin/ultimate-member/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ultimate-member/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ultimate-member/reviews/)

## Tags

 * [array](https://wordpress.org/support/topic-tag/array/)
 * [callback](https://wordpress.org/support/topic-tag/callback/)
 * [database](https://wordpress.org/support/topic-tag/database/)

 * 1 reply
 * 2 participants
 * Last reply from: [mansurahamed](https://wordpress.org/support/users/mansurahamed/)
 * Last activity: [6 years, 8 months ago](https://wordpress.org/support/topic/callback-with-datanase/#post-11889850)
 * Status: resolved