[thelist] mysql help

Bill Moseley moseley at hank.org
Sun Oct 1 20:48:09 CDT 2006


On Mon, Oct 02, 2006 at 01:18:08AM +0100, Mark Mckee wrote:
> hi
> 
> how can i thank you enough. iw as toying with the idea of having a 
> second sql statement but had no idea how to implement it

Mark, I'd just "select * from info order by category, title" then in a
loop watch for a change in category and print a new heading.


Overkill, but maybe you need two tables?  One for category and one for
links?  Then in (fake) code that abstracts your tables and knows the
relationships between the tables you do:

    for $cat in $category->select_all;
        print $cat;
        for $link in $cat->links {
            print $link;
        }
    }

-- 
Bill Moseley
moseley at hank.org




More information about the thelist mailing list