I'm consistently having a problem passing arrays to functions. (Therefore not accomplishing much)
First I the array for $username
for ($i=$beginpin;$i<=$endpin;$i++) {
$pin_info=mysql_query("SELECT username FROM pins WHERE batchid='$batchid' AND pin='$i'");
if ($row=mysql_fetch_array($pin_info)) {
$username=$row[0];
}
}
Then I pass it on to another function via a link
print"<a href=\"distributor_report.php?cmd=submit_inventory&distid=$distid&i=$i&retailer=$retailer&completed=$completed&beginpin=$beginpin&endpin=$endpin&distname=$distname&batchid=$batchid&price=$price&ordernumber=$ordernumber&username[]=$username\">Yes</a>";
function submitInventory($distid,$retailer,$completed,$beginpin,$endpin,$distname,$batchid,$ordernumber,$price,$username){
Then I try to update each element in the array into a table. It's not working with either foreach or while(list.
To see what it's doing when it gets to the function, I am having it print
foreach ($username as $user) {
echo $user;
}
All I get is the last element.
Any ideas????