View Single Post
  #3 (permalink)  
Old 07-23-2007, 11:40 PM
herschwolf herschwolf is offline
Junior Member
 
Join Date: Jul 2007
Posts: 2
herschwolf is on a distinguished road
Default ANY answer. Re: Display from tables

I'm pretty limited in my knowledge of MySQL queries and how they pull data, but my idea would be to use a foreach loop of an array to display your data.

To create your array I would first setup an empty array and then pull all the Element Descriptions first and then run a while statement to extract them and first place it into the array.

Then in the same while statement after putting that data into the array run a second statement to pull all the id's and extract those and run them through another while statement that pulls the names associated with the ids (which through each of the passes of the while statement will only contain those id's that are associated with the respective element description.

Push those names into the array and close the second while statement and then immediately close the first while statement to loop all those actions.

Then you have an array that contains the element description followed by the names associated with it. Run a foreach on the array to grab the data and display in the necessary way you want it.

It might be a little more complicated than my writing really suggests, but if you understand PHP it shouldn't be really that difficult just time consuming in testing and getting it all written.

Please feel free to email me at mail[at]herschwolf[dot]net if you want some help it as I've done something exactly like this about a month ago.

-Nathan
Reply With Quote