![]() |
Multiple Values in Single Field in DB -> Seperate Values for CI - 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: Multiple Values in Single Field in DB -> Seperate Values for CI (/showthread.php?tid=32288) |
Multiple Values in Single Field in DB -> Seperate Values for CI - El Forum - 07-19-2010 [eluser]AndrewTurner[/eluser] Hey Everyone, I've been racking my brains as to how to store multiple values in a single field and have a db relationship setup, but that's just not working, So I'm moving it over to become part of my existing CI system. I wanted to know if there's an easy way to get these values, seperate them based upon a comma and then check to see if they match another record stored in another table? In my head, It's sounding rather complicated and I can't get my head around it. Does anybody have any general ideas how to approach this, or any libraries that might be of use? Multiple Values in Single Field in DB -> Seperate Values for CI - El Forum - 07-19-2010 [eluser]mddd[/eluser] This will work, as long as your values don't contain commas and you don't want to search for them in your database. For instance, if the info is a simple list of numbers Code: // write to db Multiple Values in Single Field in DB -> Seperate Values for CI - El Forum - 07-19-2010 [eluser]AndrewTurner[/eluser] Also I forgot to add, When selected from the front end they're put into an array/string and then prepared for insertion into the database. Thanks for that, I will try it ![]() |