ok so I am having a bit of a dilema - I am trying to build a list of Primary Categories and Secondary categories sitting underneath the relevant Primary.

- Sandels
- High Heels
- Gym Shoes

It has all gone ok I have built the list of Primary categories (the query for which lives in a controller file else where that calls in the file I am about to show).

This is the page that the code generates Search although currently has an echo of the query in it.

#2486457 - Pastie

My problem is (I think) - that this query does not seem to work.

$secresult = mysqli_query($link, "SELECT secondarytubes.categoryname FROM secondarytubes INNER JOIN primarytubes ON primaryid = primarytubes.id WHERE primaryid = '$primaryCatid' ");

I personally think it is the $primaryCatid at the end as if I change this to a numerical value to represent an id eg. 1 and run it through my database directly it all works.

Anyway been on with this almost all day and stuck.

Help please.