Welcome Guest, Not a member yet? Register   Sign In
Option group select
#2

[eluser]smilie[/eluser]
Hm, there would be probably an MySQL only solution for this, but only thing I can think of is:

Do 2 query's:
First query will get only unique countries.
Then, in second query build up array of all 'name' belonging to each country.

So, you will end up with array like this:

Code:
$select = array('england' => array('name1','name2','name3'), 'wales' => array('name1','name2'));

Then, you can simply do 2 foreaches to create select (HTML) as you want it.

Good luck Smile


Messages In This Thread
Option group select - by El Forum - 09-28-2010, 04:51 AM
Option group select - by El Forum - 09-28-2010, 04:59 AM
Option group select - by El Forum - 09-28-2010, 07:22 AM
Option group select - by El Forum - 09-28-2010, 09:30 AM
Option group select - by El Forum - 09-28-2010, 10:58 PM
Option group select - by El Forum - 09-28-2010, 11:01 PM
Option group select - by El Forum - 09-29-2010, 02:18 AM
Option group select - by El Forum - 09-29-2010, 02:21 AM
Option group select - by El Forum - 09-29-2010, 02:43 AM



Theme © iAndrew 2016 - Forum software by © MyBB