Codeigniter form_helper getting database rows to be values in select menu

后端 未结 6 2167
借酒劲吻你
借酒劲吻你 2021-01-07 00:49

I am writing a form, which has a select menu in it, I want the values to pulled from the database, so I thought it would be something along these lines:

My view

6条回答
  •  猫巷女王i
    2021-01-07 01:32

    I have edited Phil Surgeon's array helper to work with a simple db query with only two fields (id & value). So the helper class now looks like this:

    And you can use it again in your controller.
    Hope it's usefull.

提交回复
热议问题