Scooby08 Posted August 22, 2008 Share Posted August 22, 2008 I'm using a database table full of items that have different categories assigned to them sort of like so.. values are id, category, description, price INSERT INTO `dw_items` VALUES (18, 'wedding_aisle', 'Palm Frond', 50); INSERT INTO `dw_items` VALUES (19, 'wedding_aisle', 'Conch Shell', 75); INSERT INTO `dw_items` VALUES (20, 'wedding_aisle', 'Tropical Flowers', 275); INSERT INTO `dw_items` VALUES (21, 'wedding_circle_of_love', 'Palm Leaves', 195); INSERT INTO `dw_items` VALUES (22, 'wedding_circle_of_love', 'Conch Shells', 75); INSERT INTO `dw_items` VALUES (23, 'wedding_circle_of_love', 'Palm Leaves and Conch Shells', 95); INSERT INTO `dw_items` VALUES (24, 'wedding_arch', 'Palm Fronds and Tropical Flowers', 225); INSERT INTO `dw_items` VALUES (25, 'wedding_arch', 'Rustic Arch', 395); INSERT INTO `dw_items` VALUES (26, 'wedding_arch', 'Rustic Arch decorated with Tulle and Flowers', 495); Is there a way to print out the array and split each category into its own table?? I'm trying to figure this out because right now I have to run a separate query for each category in order to get them into their own tables.. Quote Link to comment https://forums.phpfreaks.com/topic/120803-how-to-use-array-differences/ Share on other sites More sharing options...
Vermillion Posted August 22, 2008 Share Posted August 22, 2008 Hm, can you explain a bit more? Do you have the array? If so, can post it as well? Maybe I can help you there. Quote Link to comment https://forums.phpfreaks.com/topic/120803-how-to-use-array-differences/#findComment-622700 Share on other sites More sharing options...
Scooby08 Posted August 22, 2008 Author Share Posted August 22, 2008 The array is quite large (115 items) so I'll just post some of it: Array ( [0] => 1 [item_id] => 1 [1] => wedding_packages [item_category] => wedding_packages [2] => Wedding Package Slice of Paradise [item_description] => Wedding Package Slice of Paradise [3] => 845 [item_price] => 845 ) Array ( [0] => 2 [item_id] => 2 [1] => wedding_packages [item_category] => wedding_packages [2] => Wedding Package Barefoot Bliss [item_description] => Wedding Package Barefoot Bliss [3] => 1245 [item_price] => 1245 ) Array ( [0] => 3 [item_id] => 3 [1] => floral_arrangements [item_category] => floral_arrangements [2] => Bridesmaid and Mother of the Bride Bouquet Tropical Large [item_description] => Bridesmaid and Mother of the Bride Bouquet Tropical Large [3] => 75 [item_price] => 75 ) Array ( [0] => 4 [item_id] => 4 [1] => floral_arrangements [item_category] => floral_arrangements [2] => Corsage Tropical [item_description] => Corsage Tropical [3] => 25 [item_price] => 25 ) Let me know if that is enough.. That is 4 items from 2 categories, which Im looking to try to output into 2 tables.. Each category having it's own table.. Quote Link to comment https://forums.phpfreaks.com/topic/120803-how-to-use-array-differences/#findComment-622701 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.