Config class the best use of - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Config class the best use of (/showthread.php?tid=43758) |
Config class the best use of - El Forum - 07-22-2011 [eluser]我是一名刀客[/eluser] I'm doing a project dating marriage Data entry when: Code: <select> So Information stored in the database table is: 1,2,3,4 .. Page is displayed, the need to convert, I now do: Built in the config folder xxx.php, which wrote: Code: $config ['userdata']= In views where: Code: $userdata ['education'] [$row->education] //Where {$row->educaion} is the value read from the database Please help me identify my friends thanks, all Config class the best use of - El Forum - 07-22-2011 [eluser]LuckyFella73[/eluser] I would prefer to set up a referencing DB table with all you levels (School,degree,Master,Dr.) and do a join sql query. DB tables could look something like that: Code: // table "levels" Btw: the variable "config" is a reserved name regarding the user guide! Config class the best use of - El Forum - 07-22-2011 [eluser]我是一名刀客[/eluser] thanks,sir I heard a saying: there is an array where the database is less efficient than the present I do not know whether my understanding is correct In my project, there are many like this select Many need to be stored as digital, then convert the display time For example: Gender: Female Age: 37 Country: Philippines State / Region: davao del sur City: davao Ethnicity: Asian Appearance: Very Attractive Height: 162 cm (5'4") Weight: 35 kg (77 lbs) Eye color: Black Hair color: Black Education: College - Some Occupation: cashier Religion: Christian - Catholic Zodiac: Cancer Born in the year of: Tiger Marital status: Single Have children: No Wants children: Undecided Willing to relocate: Yes Smoking: Non smoker Drinking: Non drinker Should establish a dedicated their list? Like you just the same as the proposed table? My English is poor, sorry Config class the best use of - El Forum - 07-22-2011 [eluser]toopay[/eluser] After load the config (if you didn't autoload your config file) Code: $userdata_config = $this->config->item('userdata'); Config class the best use of - El Forum - 07-22-2011 [eluser]LuckyFella73[/eluser] Quote:I heard a saying: there is an array where the database is less efficient than the present Basically thats right but it's better to have all data in one place and if you extend your data and relations you get into trouble soon. Think what happens if you want to export all user data someday. In your DB you have the digits 1,2,3,4 etc. but only looking at your sql export you don't know what the digits stand for. If you want to set up this dating-services I would do some research about "DB normalization"! Config class the best use of - El Forum - 07-22-2011 [eluser]我是一名刀客[/eluser] Look forward to your research Config class the best use of - El Forum - 07-22-2011 [eluser]toopay[/eluser] Hey, Luckyfella were asked you to do that, not himself! |