Results 1 to 3 of 3
Thread: Struggling with a For Each Loop
Sep 5, 2011, 08:32 #1
- Join Date
- Sep 2011
- 0 Post(s)
- 0 Thread(s)
Struggling with a For Each Loop
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.
- 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.