Hey Guys,
I have two db tables. The first is a list of catagories, the second is a list of items each of which has a catagory id. What I want to do is display the data as follows:-
Cat 1
Item 1
Item 2
Cat 2
Item 1
Item 2
Because I am using Smarty, what I want to do is get the data into a series of arrays which I can then traverse in my page display code. What would be the best way to do this? My thoughts are to first grab the list of catagories into one array, then loop through this array selecting the items for each catagory into a series of other arrays with the catagory name prepended to the array name.
Any help which you can give would be much appreciated.
Multiple Arrays (mySql and PHP)
Moderator: General Moderators