I am building a kind of shopping basket for our warehouse to be able to create orders.
The baskets table will feature
id - auto increment
basketid - this groups the products together
productid - id from the product table
pickerid - person responsible for picking
completed - 1 or 0 for picked or not
so each job will feature a common basketid to group them together, i.e. one basket for the picker
id | basketid | productid | pickerid | completed
1 1 15 4 0
2 1 23 4 0
3 1 34 4 0
What I am struggling with is when a new basket is created, how do I find the highest basketid and increment by 1 to create a new basket id?
Is this a good way to go about building a shopping cart?
Thanks
The baskets table will feature
id - auto increment
basketid - this groups the products together
productid - id from the product table
pickerid - person responsible for picking
completed - 1 or 0 for picked or not
so each job will feature a common basketid to group them together, i.e. one basket for the picker
id | basketid | productid | pickerid | completed
1 1 15 4 0
2 1 23 4 0
3 1 34 4 0
What I am struggling with is when a new basket is created, how do I find the highest basketid and increment by 1 to create a new basket id?
Is this a good way to go about building a shopping cart?
Thanks