嗨,我有这个MySQL表。
CREATE TABLE IF NOT EXISTS `selling_counties` (
`county_id` int(11) NOT NULL auto_increment,
`country` varchar(20) collate utf8_unicode_ci NOT NULL,
`county_name` varchar(25) collate utf8_unicode_ci NOT NULL,
`datecreated` datetime NOT NULL,
`datemodified` datetime NOT NULL,
PRIMARY KEY (`county_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=97 ;
我需要有一个OPTGROUP选择框,其中国家将会和COUNTY_NAME将在S如
<select name ="county">
<optgroup label="England">
<option>South Yorkshire</option>
<option>Staffordshire</option>
<option>Suffolk</option>
<option>Surrey</option>
<option>Tyne and Wear</option>
<option>Warwickshire</option>
<option>West Midlands</option>
<option>West Sussex</option>
<option>West Yorkshire</option>
<option>Wiltshire</option>
<option>Worcestershire</option>
</optgroup>
<optgroup label="Wales">
<option>Clwyd</option>
<option>Dyfed</option>
<option>Gwent</option>
<option>Gwynedd</option>
<option>Mid Glamorgan</option>
<option>Powys</option>
<option>South Glamorgan</option>
<option>West Glamorgan</option>
</optgroup>
<optgroup label="Scotland">
<option>Aberdeenshire</option>
<option>Angus</option>
<option>Argyll</option>
<option>Selkirkshire</option>
<option>Shetland</option>
<option>Stirlingshire</option>
<option>Sutherland</option>
<option>West Lothian</option>
<option>Wigtownshire</option>
</optgroup>
<optgroup label="Northern Ireland">
<option>Antrim</option>
<option>Armagh</option>
<option>Down</option>
<option>Fermanagh</option>
<option>Londonderry</option>
<option>Tyrone</option>
</optgroup>
</select>
我已经尝试过这个PHP:动态下拉框OPTGROUP但它是有点复杂,对我来说我是新手用PHP,而且它是由2个独立的表来和我来自同一个表来。
任何帮助将是非常可观的。