Re: A design Q
| From: | (Richard Lynch) | Date: | Fri, 30 Jun 2000 22:04:26 +0000 |
| Subject: | Re: A design Q | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-4181@lists.php.net to get a copy of this message | ||
In article <20000625194823.A6834@digiro.net>, teo@digiro.net (Teodor
Cimpoesu) wrote:
> Hi,
> It's Sunday I know :).
>
> I am prototyping a Cart, and I am not decided where should
> I put the `Product ID'. From a design point of view it's a
> link attribute (it has a meaning only in the relation Product->Cart,
> which is an agregation, so I'll have an internal hash for this).
If *I* was doing this, I'd have three tables: Products, Carts, and Shopping
Carts would pretty much just be an ID generator, so in some SQLs, it would
just be a sequence, not a table. In MySQL, you're stuck with a table with
an auto-increment, I think.
Shopping would be a many-many relation of Products to Carts.
Maybe not the slickest thing ever, but I bet just about anybody can
understand it...
--
Richard Lynch | If this was worth $$$ to you, buy a CD
US Customer Support Director | from one of the artists listed here:
Zend Technologies USA | http://www.L-I-E.com/artists.htm
http://www.zend.com | (this has nothing to do with Zend,
duh!)