Jump to content


Photo

How to store multiple data


  • Please log in to reply
1 reply to this topic

#1 OriginalSunny

OriginalSunny
  • Members
  • PipPipPip
  • Advanced Member
  • 95 posts

Posted 14 April 2006 - 02:03 PM

Hi,
I am trying to store details of the stock for purchases made. I have got a column for the 'stockID' and the 'Quantity' in my purchases table but the problem is that a customer can buy more than one product so i don't have a clue how i am supposed to store multiple 'stockID's' for each purchase??

The only other way i can think of doing this is to store the pages (or do some sort of print screen shots of pages when the products are purchased) as i am able to display them along with the 'purchaseID' on the same page. The only thing is how do i do this in php?? Is there a way to do screenshots of pages and store them so they can be viewed??

Please help me as i have a deadline to do this by and i haven't got much time left!!
Thanks.

#2 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,023 posts

Posted 15 April 2006 - 09:35 AM

You need 2 tables, purchase_order and order_item

The order_item table will contain stock_id and qty for each item the customer orders
purchase_order          order_item
--------------          -------------
purch_id   <----------> purch_id
cust_id                 stock_id
order_date              quantity

If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users