Codeigniter form_helper getting database rows to be values in select menu

后端 未结 6 2149
借酒劲吻你
借酒劲吻你 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条回答
  •  春和景丽
    2021-01-07 01:40

    You need to return an array of strings, result() is an array of objects.

    Maybe try this in your model:

    return $query->result_array();
    

提交回复
热议问题