Answers for "js foreach multidimensional array"

0

create multidimensional array javascript for loop

var squares = new Array();
for(var i = 0; i <= 8; i++)
{
    squares[i] = new Array();
    for(var j = (i * 20) + 1; j <= 20 * i + 20; j++)
        if (squares[i] == null)
            squares[i] = j;
        else
            squares[i].push(j);
}
Posted by: Guest on February-18-2021
0

foreach array for 3 or more

foreach ($product_id as $index => $h) {
    $v = $size_id[$index];
    $q = $quantity[$index];
    $insert_pending = "INSERT INTO pending_orders 
                            (cus_id,product_id,size_id,quantity,ip_address) VALUES 
                            ('$cus_id','$h','$v','$q','$ip_address')";
    $run2 = mysqli_query($con, $insert_pending);
}
Posted by: Guest on December-04-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language