'Add to cart php mysql for angular 12

Database table descriptions

The image is the tables that I want to create and add to the cart help me I am just learning it someone can help pls

enter code here

<?php

include 'connect.php';







    if(isset($_POST['add']) && isset($_GET['id'])) {
      $id = $_GET['id'];
    
      // Check if there is a session for the cart set already, if not then set one.
      if(!isset($_SESSION['shoppingcart'])) {
        $_SESSION['shoppingcart'] = [];
      }
    
      $quantity = $_POST['quantity'];
    
      $item = [
        "id"       => $id,
        "quantity" => $quantity
      ];



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source