[gg]swift
05-02-2004, 02:43 AM
Ok, this is going to be hard to explain but I'll try,
I have a page where an admin can modify member ranks, It lists the members and then next to the name there is a drop down menu for each member with some ranks: Admin, Member, Moderator etc.
Now, I have a hidden field member_id[] and the drop menu has the name rank[]. When the form is submitted I have:
foreach ($_POST[member_id] as $member_id) {
foreach ($_POST[rank] as $rank) {
Then here is where I update the mysql database with the values
}
}
But I keep getting double results and it then it only changes the last members information. I kinda solved the problem with array_combine in PHP5 but if the two variable's values are the same it returns an error, so I am looking for an alternative. Thanks.
I have a page where an admin can modify member ranks, It lists the members and then next to the name there is a drop down menu for each member with some ranks: Admin, Member, Moderator etc.
Now, I have a hidden field member_id[] and the drop menu has the name rank[]. When the form is submitted I have:
foreach ($_POST[member_id] as $member_id) {
foreach ($_POST[rank] as $rank) {
Then here is where I update the mysql database with the values
}
}
But I keep getting double results and it then it only changes the last members information. I kinda solved the problem with array_combine in PHP5 but if the two variable's values are the same it returns an error, so I am looking for an alternative. Thanks.
