im making an ecommerce website and since it have different products like phone clothes etc .. the product variables are differents so i made three tables one for the product[idpname,description,photo] , the secend table for the variable[idv,idp,name] and the third one for the varibale details[idv,name,quantity,price] i made a form with option that i show from the database but the probelme is how can i insert the user choice into shopping cart table also the html and php code is wrong
<form method="post" id="my">
<?php
$req_option=mysqli_query($conn,"select * from optionp where idp=$idp");
while($data_option=mysqli_fetch_assoc($req_option)){
$ido = $data_option['ido'];
?>
<p class="text-dark font-weight-medium mb-0 mr-3"><?php echo $data_option['nomo']; ?> :</p>
<?php
$req_option_detail=mysqli_query($conn,"select * from optiondetail where ido=$ido");
while($data_option_detail=mysqli_fetch_assoc($req_option_detail)){
?>
<div class="custom-control custom-radio custom-control-inline">
<input type="radio" class="custom-control-input" id="<?php echo $data_option_detail['idod']; ?>" name="optionp" value="<?php echo $data_option_detail['nomdo']; ?>">
<label class="custom-control-label" for="<?php echo $data_option_detail['idod']; ?>"><?php echo $data_option_detail['nomdo']; ?></label>
</div>
<?php } ?><?php } ?>
</form>