To any one who can assist... Thanks Ahead of Time!
Here is my problem.. I am pulling items from one database that are displayed as check box options in a form. Once the user checks any or all of the variables that apply, I need to enter them into another database. I can get this to work if only one variable is checked, but as soon as more than one is checked, it is only inserting the last check box checked.. Here is an example of what I have now:
<?php
// 1. FIRST TIME THROUGH. DISPLAY FORM.
if (! $HTTP_POST_VARS) {
echo"
<FORM ENCTYPE=\"multipart/form-data\" METHOD=\"post\">
Title:<br> <input type=\"text\" name=\"title\" size=25 maxlength=255><br>
Amount: <font size=1>(Enter in this format: If entering a ten percent discount, enter it like this - .10)</font><br> <input type=\"text\" name=\"amount\" size=25 maxlength=255><br>
Select Items to Apply This Discount To:<br>
";
$result = mysql_query("SELECT * FROM iteminfo where url= 'test.com' ");
if (! $rowarray = mysql_fetch_array($result))
{ echo "<br>You don't have any items listed at this time."; }
else {
$result = mysql_query("SELECT * FROM iteminfo where url= 'test.com' order by item");
while ($rowarray = mysql_fetch_array($result))
{ echo"
$rowarray[item] <input type=\"checkbox\" name=\"number\" value=\"$rowarray[item_number]\"><br>
";} }
echo"
<input type=\"submit\" value=\"Submit\" style=\"font-size: 10; font-family: Arial, Verdana, Helvetica; color: #ffffff; background: #7D8EAF; width: 50px; height: 19px;\">
</form>
"; } else
// 2. SECOND TIME THROUGH.
{
$result = mysql_query("SELECT * FROM iteminfo where url= 'test.com' order by item");
while ($rowarray = mysql_fetch_array($result))
{
if ($rowarray[item_number] == $number)
{ THIS IS WHERE I WOULD ENTER THE VARIABLES INTO THE DATABASE, BUT IT WILL ONLY ENTER THE LAST ITEM CHECKED IN THE LIST}
}
}
?>
Thanks for any help anyone can give.. CJ