I don't do much programming but enjoy doing it with little programs that make my working life a little easier. So my knowledge is very limited.
I am writing a little control program for purchase orders. When I price up a job I create a parts list against a job number (that I create). When I do the job I want to take the items (not all at the same time) in this job item list, allocate them to a Purchase Order number / supplier and create an electronic Purchase Order.
I have got to the stage whereby I can extract the relavent information from a data base and against each line I have a checkbox and textfield. All within a form.
What I want to do (and just can't get it right) is to be able to choose the item and allocate a value, for many items and move this to the next page.
In my script I have
$query2 = "SELECT * FROM prepop1 WHERE PPjob='$code'";
$result2 = mysql_query($query2) or die ("Couldn't execute query 271");
while ($row2 = mysql_fetch_array($result2))
{
extract($row2);
echo "<td>$PPqty $PPcode </td>";
echo "<td>$PPdesc</td>";
echo "<td>$PPmat</td>";
echo "<td><input name='part[$PPCode]' type='checkbox' value='$PPCode' />
<input name='textfield[PPCode]' type='text' size='6' value=$PPqty />
</td></tr>";
}
When I get to the 'next page' I have written
foreach ($_POST as $part[$PPcode] == Y)
{
echo " $part[$PPcode] $textfield[PPCode]";
}
Ths doesn't work but I am strugling to work out what I should be doing.. If anyone could assist i ould appreciate it.
Thanks
Andy