in reply to Pulling out information for MySQL

listen in this shopping cart script the reason there like that isbecause theuser can keep on adding categories in categories in categories and they will al be seperated by a pipe.

Replies are listed 'Best First'.
Re: Re: Pulling out information for MySQL
by gryphon (Abbot) on Jul 19, 2002 at 18:03 UTC

    Greetings andrew,

    You really, really don't want to do it that way. Your database will be extremely not normalized. However, if you insist:

    SELECT name FROM category WHERE name NOT LIKE '%|%'

    Essentually, you're selecting all category names that don't have a pipe in them. However, like I said, you really should seperate the categories into single items that reference each other with ids.

    -gryphon
    code('Perl') || die;