![]() |
PHP Nesting?
I am not the most fluent with PHP but I am with other languages ...
What I am trying to do is one query and list out the info, but for each listing it needs its own query. I may be going about it the wrong way (well obviously since its not working). Code:
function getlist() Can anyone get me a step into the right direction? |
This is my best guess as to what you are trying to do. Hope it helps. :)
Code:
function getlist() |
That is where I started to take it by doing a Join ...
but then I still run into a problem for every class_name/class_desc there might be quite a few options that I want to loop thru - and I want each class to only be listed once. So thats also where I am confused. Code:
function getetlist() |
You can do a groupby and group all the classes with the same name together so they are only showed once.
|
When I was thinking of doing two queries I could understand how I wanted to loop each query differently - but writing a query as already mentioned or with a join I still dont know how it would loop thru the classes and then loop each list of options for each class
|
What fields etc are in your two tables and what exactly are you trying to do with them, display etc - I'm somewhat confused reading this.
|
Table 1:
id name desc Table 2: id "table1_id" user time notes ...display Class 1 Desc 1 user time 1.2 user time 1.3 user time 1.4 Class 2 Desc 2 user time 2.2 user time 2.3 So to query the first table and loop the results, but for each listing it would loop the times under that class . |
This is another guess as to what you are trying to do. Hope it helps. ;)
Code:
function getetlist() |
Thanks calorie :)
This works :) ... I did do a join tho in the query to make it list it all out. |
All times are GMT. The time now is 08:15 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|