Hi,
I want to make online shop and I made most of it but I have problem on product page.I want for "customers" ( this is my personal project so ... ) to be able to choese and then what they choese to be store into table.

I struggling with this more then 3 hour , I try everyhing , this is my last shoot.

(I used the echo because I want to show it , so after that I would put insert into, but ... I was not able to do it )

<?php
$con = mysqli_connect("localhost","root","","basic");

$query = mysqli_query($con,"SELECT * from web");

while($row = mysqli_fetch_array($query))

    $name = $row['name'];

 if(isset($_POST['submit'])){

 echo $name;    

 }

?>
<div class="product">
<div class="col-md-6">
<div class="card">
<input type="checkbox" name="name"><?php echo $name;?>
 </div>
</div>

<?php
}
?>

<form action="details2.php" method="POST">
<input type="submit" name="submit">
</form>

Inputs should be inside form. Inputs with similar names should be pass as array.

<input type="checkbox" name="name[]" value="<?php echo $name;?>" /><?php echo $name;?>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.