Hi everyone, this is my first time using daniweb, so helo!

I have a major issue with building a menu from a query.

I have the following, a query built from a join

from 4 tables

my query returns the following

Id cat name sub 2sub con

3 1 axle flat round 7
4 1 axle metal round 7
5 1 axle plas round 7
6 1 axle woo round 7
7 1 pod metal round 6
8 1 pod plas round 6
9 1 pod woo round 6

the con column identifies it as an axle or a pod.
each line is actualy supposed to be a link.

I have been trying to build somthing like this:

<a href=3>flat round </a>
<a href=4>metal round </a>
<a href=5>plas round </a>
<a href=6>woo round </a>

<a href=7>......</a>
<a href=8>........</a>
<a href=9>.........</a>


the real query returns about a hundred rows formated the same way.

Is it possible to build a menu from this??

So far ive found 2 possible solutions ,

1. Ive found a few functions that create menus but they require a parent id and since my menu is built in various tables it wont work unless I redo everything.

2. Ive been trying out some arrays, but I cant get it working,

I am dieing here , has anyone faced a similar problem and can guide me???

thanks a lot.

7 Years
Discussion Span
Last Post by diafol

i suggest

select * from `record` group by 'con' order by 'id'; 

and use the <ul> and <li>

Edited by mike_2000_17: Fixed formatting


Sometimes, you just have to bite the bullet and redesign your DB. If you show your DB design and explain what each field means, with what you wan to display, we'd all have a better idea.

Edited by diafol: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.