www.webdeveloper.com
Results 1 to 3 of 3

Thread: Need a little database help!

  1. #1
    Join Date
    Jul 2005
    Location
    Singapore
    Posts
    65

    Need a little database help!

    I'm doing an inventory system project, and I've already done the part where product balances can be checked out or checked in.

    However, I'm trying to record the transactions now and I'm abit stumped because 1 transaction may 1 or more product and value.

    For example, withdrawal Transaction A:
    1. Pots - 10, 5
    2. Pans - 4
    3. Plates - 20

    As the number of items in the transaction can vary from 1-50, the only way I thought that it's possible to store the transaction in one table row, is to use tokens.. but that would be messy. Anyone got a cleaner way of doing this?

    Thank you for reading!

  2. #2
    Join Date
    Jun 2003
    Location
    here
    Posts
    4,551
    one to many relationships?

    just give each transaction a primary key, then make a second table for items in the transaction, which has the foreign key matching it up to the transactions table. problem solved.
    If you are using PHP please use the [PHP] and [/PHP] forum tags for highlighting...
    The same applies to HTML and the forums [HTML][/HTML] tags.

  3. #3
    Join Date
    Jul 2005
    Location
    Singapore
    Posts
    65
    Woah.. thanks!
    I kinda forgot all the database stuff I learned.. XD

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles