Mysql order list, how to design shopping cart list, connect them to form a complete system, such as the following table structure

< H2 > question < / H2 >

want to add a shopping cart table, let users add items to the shopping cart, click settlement to generate the order, but do not know how to design and associate

< H2 > reference < / H2 >

the link I referenced
https://blog.csdn.net/wgyscsf.

customer(): cidcnamecphonecaddress
merchant():midmnamemphonemaddress
product():pidpnameppricepremainmid
order():oidodatetimeostateosummoneycid
orderitem():oiidiobuynumiosummoneypidoid

Shopping cart list: user id, goods id, goods quantity


you should think about where the shopping cart comes from and where it goes. Maybe it's a little weird to say that, so if you want to add goods to the shopping cart, where should it come from?
first of all, who the shopping cart belongs to, so you have to declare this by adding a field to record the user ID.
then, what is put in the shopping cart, you need to record the ID of the corresponding item, so this is also necessary.

if the order is finally generated

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bf5364-317a2.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bf5364-317a2.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?