General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old August 26th, 2003, 11:11 PM
m34d0w m34d0w is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 3 m34d0w User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
multi-dimensional array help

i have a shopping cart. the shopping cart is really freaking complex. it's using OOP. i currently use 2 MD arrays to store all of the cart products. they are setup like this:

product array:
array_id => product_id => quantity

option/spec array:
array_id => spec_id => product array id

in order to correlate the option/spec array with the product array, i use the "product array id".

let's say a user has productA with optionA + optionB in their cart.
they also have productB with optionC.
they then decide that they don't want productA with the 2 options.

my problem is that of updating the option/spec array's product array id with the new array_id in the product array.

it's so complex right now, i can't think straight anymore.
should i just unset the array and repopulate it? surely there is a more appropriate way...

thanks!

Reply With Quote
  #2  
Old November 20th, 2003, 04:17 PM
digitallysmooth digitallysmooth is offline
you know how we do
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jun 2002
Posts: 788 digitallysmooth User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 34 m 21 sec
Reputation Power: 7
I may be totally wrong here, but it looks to me like you over complicated the situation by working with two MD arrays.

At first glance I wonder why not just store it all in one array, where the item's options were just under another key called 'options'.

I would take steps to make that part simpler and I think everything will fall in-line thereafter.
__________________
__________________________________________________ _
Wil Moore III, MCP | Integrations Specialist | Senior Consultant
Are You Listed...? | DigitallySmooth Inc.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > multi-dimensional array help


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT