Jump to content

basket help cheers


redarrow

Recommended Posts

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.