thanks but this doesn't achieve what I was looking for
example
the website table looks like this
---------id colour quantity
Item#1 101 ------ ------
Item#2 102 ------ ------
Item#3 103 ------ ------
Item#4 104 ------ ------
Item#5 105 ------ ------
the id comes from a previous query to the database
the user fills in the blanks
but if they only fill in the colour / quantity for item #3 I only want that record added to the database
using this code adds all 5 records with 0 in the fields where the user hasn't put any information in
if (isset($_POST['Quantity']))
// or if I use if (!empty($_POST['Quantity'])) it still doesn't work
{
$arr_size = count($_POST['Quantity']);
for ($i=0;$i< $arr_size;$i++)
{
$Quantity = strip_tags(trim($_POST['Quantity'][$i]));
$Colour = strip_tags(trim($_POST['Colour'][$i]));
$Id = ($_POST['Id'][$i]);
$query = "INSERT INTO tblResults (Ref,MRef,SRef,ClRef,Quantity,Colour,LoadedBy)
VALUES ('$Ref','$MId','$SRef','$CRef','$Quantity','$Colou
r','$UserId')";
$result = mysql_query($query)
or die(mysql_error());
} //close for
} //close if
any ideas anyone?