Hello
I have a simple INSERT PROBLEM
here is the scenario
<tr>
<td height="62" align="right" valign="top" width="30%">SIZES</td>
<td valign="top">
<table>
<?
$seek_size = mysql_query ("SELECT * from tbl_size");
while ($sizes = mysql_fetch_object($seek_size))
{
$val_size= "$sizes->SizeCategory";
$val_size.="-";
$val_size.="$sizes->Size";
?>
<tr>
<td>
<input type="checkbox" name="size[]"><?=$val_size?>
</td> <td> PRICE: <input type="text" name="price[]">
</td>
</tr>
<?
}
?>
</table>
</td>
</tr>
With this code It will display 2 columns the first column is a checkbox and the other column is a textbox for prices
The size is related to price.
Now i am saving this to the database
for($x=0; $x<sizeof($size); $x++)
{
$sqlshirtsize2 = "insert into tbl_premadesizes (premade_shirtID, size, price) values('$id', '$size[$x]', 'price[$x]')";
mysql_query ($sqlshirtsize2) or die ("err3:=" . mysql_error ());
}
The problem is when i save run the insert query SOme of the value of text box is = 0. Isn't it that only the selected checkbox will be save together with the price but why is that the some of the value of the textbox is 0. This makes me sick. I cant figured out why. Any comments on my code and know where the bug is? thanks for the time