I want to item\'s subcatory selected when editing category:
I have solved the problem by:
$selected = $d == $subcat ? " selected " : ""; $text .= ''.$r['name'].''; function sQuery($x, $y) { $selected = $x == $y ? " selected " : ""; return $selected; }