By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,842 Members | 1,097 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,842 IT Pros & Developers. It's quick & easy.

sorting an array based on one of many form fields?

P: n/a
Subject line confusing? The whole thing is confusing to me.
OK, I think the root of my problem, aside from mental, is array
based...but I'm not even sure what I want to do is even possible. So
if I can get far enough to know that one way or the other, then I can
try to figure out how to do it.

But here's the situation:

Page 1 I have a form with many item rows pulled from a database query.
Among other fields, each row contains a checkbox to select the item
and a text field which contains an item_description.

On submit, I have it so that every checked item goes onto the next
page where more stuff happens to each item, and the select items end
up in an HTML table as well as a CSV spreadsheet.

Now, because the selected items are pulled from an array based on the
checkbox, the sort order is based on the item's unique ID number. WHat
I'm being asked is if I can have the final results sorted by that
item_description field I mentioned before. Which can occurr at the end
of the 2nd page's processing, sure.

Well, here's what I have to select the items:
Page 1:
(Each row has this checkbox, with $oim being its id number.)
<input name=\"shipsel[]\" type=\"checkbox\" value=\"$oim\">
<textarea rows=\"5\" name=\"ta$oim\" size=\"30\" tabindex=\"0\"

Page 2:
if ($shipsel) {
foreach ($shipsel as $v) {
(and then LOTS and LOTS of other stuff....)

You can see each item_description textfield also has a unique
identifyer for it's name based on the item's ID.

So, I have no idea. If it's possible, do I put the entire collection
of data, each row selected and sent to page 2, into some sort of array
and is there some way to then re-sort all that data based on a column
in that array?

Did this make any sense at all??

Thanks for any help. =)
Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.