How can guys insert pictures into this script? I have 6 parent categories and each parent must have its own picture. This is my entire category code, of course without styles.
<?php $result = mysql_query ("SELECT `id`, `parent_id`, `name` FROM `category`"); $cats = array(); while($cat = mysql_fetch_assoc($result)) $cats[$cat['parent_id']][] = $cat; function create_tree ($cats,$parent_id){ if(is_array($cats) and isset($cats[$parent_id])){ $tree = !$parent_id?'':'<ul>'; foreach($cats[$parent_id] as $cat){ $tree .= "<li>"; $tree .= !isset($cats[$cat['id']])?"<a href='view_cat.php?cat=".$cat['id']."'>".$cat['name']."</a>":"<span>".$cat['name']."</span>"; $tree .= create_tree($cats,$cat['id']); $tree .= '</li>'; } $tree .= !$parent_id?'':'</ul>'; }else return null; return !$parent_id?'<ul class="sublist">'.$tree.'</ul>':$tree; } echo create_tree($cats, 0); 
imgtag beforeaandspan? - Arnialimgneeded beforeul. In order for them to be different, substitute differentsrcinto pictures. - Arnial