How would i put the $newd values into the database. The way I'm doing it now just puts one value in. I want all values.
<?php
$checked = $_POST['options'];
for($i=0; $i < count($checked); $i++){
    $newd = "" . $checked[$i] . ",";
}   
    if(isset($_POST['loginbtn'])){
        if(!empty($order)){
if($money){
    //making the sql command
    $sql = "INSERT INTO `orders`(`order`,`date`,`time`,`timepass`,`money`,`corder`,`cancel`,`category`) VALUES ('$order','$date','$timenow','$time','$money','$corder','$cancel','$newd')";
    //querying the sql
    $query = mysqli_query($db,$sql);
    $lastid = mysqli_insert_id($db);
    $twosql = "INSERT INTO `comments`(`order_id`, `comment`,`user`,`time`,`timepass`) VALUES ('$lastid','$comment','$username','$timenow','$time')";
    $twoquery = mysqli_query($db,$twosql);
    header("Location: moneyorder.php"); 
}
?>
 
     
     
    