Jump to content


Photo

basket help cheers


  • Please log in to reply
3 replies to this topic

#1 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 06 July 2006 - 06:57 PM

Does this way of thinking to design a basket correct please cheers.

Add to basket database

users_id
ip
time
date
product
price

let the user see the items in basket

select statement

let the user delete items

delete satement


copy the whole added basket to the users members page on checkout

update

then delete the basket database via the users_id as the user got a copy in member view

delete


Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#2 craygo

craygo
  • Staff Alumni
  • Advanced Member
  • 1,973 posts
  • LocationRhode Island

Posted 06 July 2006 - 07:06 PM

You would also want quantity. Probably just the productid as well. All other information would come from the product table anyway.

user_id
ip
time
date
productid
quantity

When order is paid you can move data into an "orders" table which will assign an order id along with holding the user_id. This way you will have a history of orders for lookup.

Ray

#3 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 06 July 2006 - 07:50 PM

was not far out then ha lol..................

know the full database lol.

what you think my man lol.......................

members_database

members_id // members id
members_name // members name
email // members email
members_phone_number // contact number
members_address // addressinfo
date_registred  // registration daye
end_date // subcription one year
ip // members ip

produts for sale database

product_id //poduct id
product_name //product name
how_meny // how many there are
product_price // price of item


basket database

members_id  // users id of buyer
members_name //users name of buyer
time  // time buy product
date  // date buying product
ip // members ip
product_id  // product id
product_name // product name
how_many // how many buying
product_price // how much

basket database copy for members

members_id  // users id of buyer
members_name //users name of buyer
time  // time buy product
date  // date buying product
ip // members ip
product_id  // product id
product_name // product name
how_many // how many buying
product_price // how much

$query="SELECT SUM(product_price) FROM basket where members_id='$members_id' ";

To sum up a total is this correct.

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#4 craygo

craygo
  • Staff Alumni
  • Advanced Member
  • 1,973 posts
  • LocationRhode Island

Posted 13 July 2006 - 02:34 PM

you may want to have a "orders" tanle as well. This will hold the order once it is purchased with an orderid. This way you have a history

The basket will ultimately be a temporary table which would be transfered to the order table once purchase is made.

I do not think you would need the product name in the basket or the order, just the productid. All information should be linked. Same with the member name.

members_database

members_id // members id
members_name // members name
email // members email
members_phone_number // contact number
members_address // addressinfo
date_registred  // registration daye
end_date // subcription one year
ip // members ip

produts for sale database

product_id //poduct id
product_name //product name
qty_on_hand // how many there are
product_price // price of item


basket database

members_id  // users id of buyer
time  // time buy product
date  // date buying product
ip // members ip
product_id  // product id
how_many // how many buying
product_price // price of item at time of purchase since prices may change

Order Database

order_id //Order number
members_id  // users id of buyer
time  // time buy product
date  // date buying product
ip // members ip
product_id  // product id
how_many // how many buying
product_price // price of item at time of purchase since prices may change

Your query looks fine to me.

Sorry for late response.

Ray





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users