How can i create a add to cart function . is there any way to created using data base?

Here’s what we discussed recently.