about database and loop |
I have some data in my database :
Code: |---|--------------|----------------| I call all the data where : Code: country_code = session()->getFlashdata('customer.addr_country') And loop them, because I want to display in view with form_dropdown() and old() function. I create the loop like this : PHP Code: $_list_province = ['HIDE_' => 'Provinsi']; The $row['province] show the province that listed in database (where country_code), but the $row['id'] can not display from 11, 12, ... (as in database) it shows number from 0,1,2,3 .... until end. I think its not good, because I need the $row['id'] display data from database (11,12, ...) this is some of the output Code: <option value="" hidden="" >Provinsi</option> if I do or try to array it again PHP Code: $_list_province = array_merge([$_list_province]); it show : Code: <optgroup label="0"> |
Messages In This Thread |
about database and loop - by mjamilasfihani - 06-01-2020, 09:49 AM
RE: about database and loop - by mjamilasfihani - 06-01-2020, 10:52 AM
|