Yeah, thats exactly what I wanted to do. But how do I make MySQL sort it
like that? Show the parent first, and then all its childs, so the
application can determite if it's subcategory by checking if the parent is
was changed.

Sagi

From: "olinux" <[EMAIL PROTECTED]>


> create a table like this:
> id | parent_id | category
>
> parent_id points to the parent categories id. Top
> level categories get parent_id of '0'
>
> ex:
> 1 | 0 | auto
> 2 | 1 | repair
> 3 | 2 | body
> 4 | 2 | windshields
> 5 | 1 | detailing
> 6 | 2 | tires
>
> Tree would look like:
> auto
>    repair
>       body
>       windshields
>       tires
>    detailing
>
> olinux
>




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to