|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Unecessary column in shopping cart article?
In the PHP mysql shopping cart article what is the reason for the cartId column?
create table cart ( cartId int auto_increment not null, cookieId varchar(50), itemId int, qty int, primary key(cartId), unique id(cartId) ); It doesn't seem to have any function even though it is named the same as the cookies name(meaning the cookies name in the name/value pair). Last edited by enormo : August 18th, 2003 at 03:25 PM. |
|
#2
|
|||
|
|||
|
cartID is the unique identifier for that row. there is no guarantee that cookie id will be unique.
|
|
#3
|
|||
|
|||
|
Quote:
Do you mean that every table should have a unique identifier as a basic rule? Because even if the cookie id is not unique, the "cartID" column in the cart table is never refered to in the rest of the script. |
![]() |
| Viewing: Dev Articles Community Forums > Databases > General SQL Development > Unecessary column in shopping cart article? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|