Forum Moderators: coopster
$SQLcat = "SELECT * from CATEGORIES ORDER BY TITLE ASC";
$resultcat = @mysql_query( $SQLcat); while( $rowcat = @mysql_fetch_array( $resultcat ) ) {
$SQLc1 = "SELECT * from CATEGORIES WHERE ID = '$rowcat[CATEGORY]'";
$resultc1 = @mysql_query( $SQLc1 );
$rowc1 = @mysql_fetch_array( $resultc1 );
//---------------------------------------
?>
<option value = "<?php echo "$rowcat[ID]"; ?>">
<?php echo "$rowcat[TITLE]"; if ($rowc1[TITLE] != $nil) echo " :: $rowc1[TITLE]"; ?>
</option></select>
this code show all cat and all subcat in menu but sort by name for all id
NOTE : if cat or subcat have id ! Example :
Example is cat ! example 2 example 3 example 8 is subcat !
ExampleL is cat ! so 1 so 2 so 3 is sub cat !
until show in menu sort by name ! how to edit this code for sort by this idea :
Example
Example 2
Example 3
Example 8
ExampleL
so 1
so 2
so 3
. . . . . . .
This menu for search site by category .
thanks !
[edited by: Why_not at 8:45 am (utc) on June 2, 2008]
[webmasterworld.com...]