try -
while ($line <= $total -1){
$line++;
$statement[] = "(".$myid . "," . $item[$line]['quantity'] . "," . $item[$line]['options'].")";
}
$sql = "insert into products values ".implode(",",$statement);
$result=mysql_query($sql)
This creates an array of $statement
with values like
(id,qty,product)
and then on the implode()
the query becomes -
insert into products values (id,qty,product),(id,qty,product),...
edit
based off your edit, try -
for($i=1; $i < $content['itemCount'] + 1; $i++){
$quantity = 'item_quantity_'.$i;
$options = 'item_options_'.$i;
$item_number['total'] = $i;
$exploded = explode(' ', $content[$options]); // need to use the $content[] here
$item_id = $exploded[1];
$item[$i]['quantity'] = $content[$quantity];
$item[$i]['options'] = $item_id; // use the exploded value, not the $content[]
}
$total = $item_number['total'];
$line = 0;
while ($line <= $total -1){
$line++;
$statement[] = "('".$myid . "','" . $item[$line]['quantity'] . "','" . $item[$line]['options'] ."')";
}