the idea is to insert the same data to SQL DB $quantity times it mean that if i have quantity = 10 the SQL query need to insert the same data 10 times the problem is that always i have one record more mean if i have the quantity=2 i will have 3 records if I have it to 1 i will have 2 record and so
$i=1;
while ($i<="$quantity")
{
$sql="INSERT INTO arivage (ID_Ship, Date_ariv, Date_achat, prov_id, Sph, cyl, Prod_type, Pord_color)
VALUES ('', '$date', '$date1', '$prov_id', '$sph', '$cyl', '$Prod_type', '$Prod_color')";
mysql_query($sql);
$i++;
}
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
i have the sql connection and closing in the code too.
$quantity?