MySQL
cat_id cat_group cat_name cat_status
1 Vehicles Cars 1
2 Vehicles Motorcycles 1
3 Properties Houses 1
4 Properties Apartments 1
5 Electronics Cameras 1
6 Electronics Gadgets 1
HTML
<select id="category" name="category">
<optgroup label="Vehicles">
<option value="1">Cars</option>
<option value="2">Motorcycles</option>
</optgroup>
<optgroup label="Properties">
<option value="3">Houses</option>
<option value="4">Apartments</option>
</optgroup>
<optgroup label="Electronics">
<option value="5">Cameras</option>
<option value="6">Gadgets</option>
</optgroup>
</select>
PHP
function cat_option()
{
global $db;
}
Soru
Nasıl kategorilerinin döngü için bir php fonksiyonu oluşturmak mı? Yani formda Ben sadece cat_option()
and the results will looks like on HTML
strong> tarafından çağrı