Welcome to Dream.In.Code
Getting Help is Easy!

Join 136,176 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,953 people online right now. Registration is fast and FREE... Join Now!




Wish List development help

 
Reply to this topicStart new topic

Wish List development help

cool263
10 Dec, 2007 - 09:47 AM
Post #1

New D.I.C Head
*

Joined: 17 Jul, 2007
Posts: 19


My Contributions
Hi everyone,

I'm a self-taught newbie who's looking to develop (using VB Script) a "wish list" feature for an online tourism agency, but not sure what to do.

It needs to work some like this: the visitor views events, places to stay, things to do, etc. and is given the option to add that item to a wish list of things to do when they visit that area. The visitor could save their list by creating an account.

So, I guess my questions are:

1. Would a wish list be built just like a shopping cart?

2. If so, what database should I use and how would it be set up? (I really don't have much experience with databases yet.)

3. If not, how would I go about doing this?

4. Does anyone know of a Wish List script that's available?

Any help and code examples would be really appreciated as I feel pretty lost and overwhelmed with this task.

Thanks,
Steve
User is offlineProfile CardPM
+Quote Post

Martyr2
RE: Wish List Development Help
10 Dec, 2007 - 10:45 AM
Post #2

Programming Theoretician
Group Icon

Joined: 18 Apr, 2007
Posts: 5,199



Thanked: 213 times
Expert In: C/C++, Java, VB, VB.NET, C#, PHP, Web Development, HTML & CSS, Javascript

My Contributions
Yeah this is essentially a shopping cart. The database will depend on the machine hosting it, but any database can work. I would go with one that supports referential integrity (keys). The idea is that you are going to have three tables. One will be for the user's account and has an account ID that is assigned to them when they signup (this can be a auto_incrementing primary key). A table that has all the items you have for the site which each item has their own item id and another which will keep a list of IDs for items in their wishlist. You don't have to store much more information in the wishlist table than the items unique key id because then you could use that ID in a query to pull the items information as needed.

CODE

User
-----------------
UserID
Name
Email
Password

Items
-----------------
ItemID
Itemname
Quantity
Price

User_Wishlist
-----------------
ID
UserID
ItemID


As you can see the user_wishlist table has a link to the userID and a link to ItemID. This table can have multiple ItemIDs for each userID and will look like...

CODE

1,3,10
2,3,22
3,4,10


This above says that wishlist for user 3 has two items, item 10 and item 22. User 4 has item 10 only. I hope that part makes some sense.

I was not able to find any article that gave you the simple relationship here because it is pretty elementary database design but you can look at shopping cart table design or the classic "order/item" table design which fits very close with this. Just replace order with the idea of a wishlist.

I hope this information helps. smile.gif


User is offlineProfile CardPM
+Quote Post

cool263
RE: Wish List Development Help
10 Dec, 2007 - 11:41 AM
Post #3

New D.I.C Head
*

Joined: 17 Jul, 2007
Posts: 19


My Contributions
Thank you Martry2, this really helps although I'm still a bit confused. I'll probably use MySql for the db, would this work in regards to the "referential integrity (keys)"? If so, I can set up the tables, but do I need to make a relationship between each table so that they know where to pull information from? (I may be wording this completely wrong.) I'm assuming I would use a loop (or similar statement) to find each instance of the user_id and display each item that's been found? If so, do I need to do anything with the ID in the user_wishlist table?


User is offlineProfile CardPM
+Quote Post

cool263
RE: Wish List Development Help
14 Dec, 2007 - 02:59 PM
Post #4

New D.I.C Head
*

Joined: 17 Jul, 2007
Posts: 19


My Contributions
Never mind. I have it working now.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 12:53AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month