Nodral Posted April 21, 2011 Share Posted April 21, 2011 Hi I have a database which has been built by another party and they have used a field called param1 which contains all the details from a prepopulated dropdown list. This is then referenced by number from another field (fieldid) in another table to get the single result. How do I go about replicating this to get one answer? eg Param1 = Thailand Tunisia Turkey Ukraine United Arab Emirates United Kingdom United Kingdom - Islands - Guernsey United Kingdom - Islands - Jersey United Kingdom - Islands - Isle of Man Virgin Islands fieldid = 6 hence this returns United Kingdom. How can I split all the options out. I thought about returning all entries and pattern matching, but as you can see there are some results which would contain capitals in vaiours places or speaces etc within the field. I'm stumped!!! Any ideas? I can't change the way the database, but I need to be able to get the information out in a usable format. Stu Quote Link to comment https://forums.phpfreaks.com/topic/234326-list-in-mysql-field/ Share on other sites More sharing options...
kickstart Posted April 21, 2011 Share Posted April 21, 2011 Hi How do you know that "United Arab Emirates" is one item and not 3? All the best Keith Quote Link to comment https://forums.phpfreaks.com/topic/234326-list-in-mysql-field/#findComment-1204403 Share on other sites More sharing options...
Nodral Posted April 21, 2011 Author Share Posted April 21, 2011 That's the issue I have with splitting it. Is it possible it could be using char(13)? Quote Link to comment https://forums.phpfreaks.com/topic/234326-list-in-mysql-field/#findComment-1204405 Share on other sites More sharing options...
Nodral Posted April 21, 2011 Author Share Posted April 21, 2011 Sorted from another developer on another forum $details = explode("\n", $details); Quote Link to comment https://forums.phpfreaks.com/topic/234326-list-in-mysql-field/#findComment-1204407 Share on other sites More sharing options...
kickstart Posted April 21, 2011 Share Posted April 21, 2011 Hi Right, it is a new line separated field. All the best Keith Quote Link to comment https://forums.phpfreaks.com/topic/234326-list-in-mysql-field/#findComment-1204414 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.