ballhogjoni Posted July 16, 2008 Share Posted July 16, 2008 Ok I am lost in this logic, can someone guide me in the right direction? I want to place all the category names in an array and then I want all the shows to be in the respective categories. IE. array(['Category Name 1']=>array([0]=>show1,[1]=show2),['Category Name 1']=>array([0]=>show1,[1]=show2) This is the code I have so far... <?php $results = $this->db->query("SELECT shows_id FROM Shows WHERE dont_show_on_main_list=0 ORDER BY name"); $showCategoriesQueryResult = $this->db->query("SELECT Shows_Categories.shows_id,Categories.category_name FROM Shows_Categories,Categories WHERE Shows_Categories.category_id = Categories.category_id"); while($results->fetchInto($row)) { $show2 = new Show($row['shows_id']); $temp_show = $show2->getData(); //gets the data from the Shows table based off of the id passed in while($showCategoriesQueryResult->fetchInto($rows)) { //I think I want to do something here but I dont know what. } $showInfo['category_id'][] = $temp_show; $quickshowlinks[] = $temp_show; } ?> Link to comment https://forums.phpfreaks.com/topic/115047-multi-array-question/ Share on other sites More sharing options...
ballhogjoni Posted July 16, 2008 Author Share Posted July 16, 2008 Thanks guys I got it all figured out. Link to comment https://forums.phpfreaks.com/topic/115047-multi-array-question/#findComment-592008 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.