Script help: sortable info gathered from user input?

LanceM

Senior member
Mar 13, 2004
999
0
0
I gather the likely solution would be in PHP/MySQL, but I just wanted some suggestions before I get started (I've never really used PHP before aside from a small news script). I can't seem to find anything pre-written that wouldn't have to be completely torn down.

What I need is for a user (it doesn't necessarily need a login system) to be able to enter data into a few fields. A small example would be name, date, and total hours a project was worked on.

The output should be in a separate file available for an instructor-type user, in this format:
Name | Date | Hours

I can certainly get something like that up and running, but how much more work would it take to get this sortable by column headers?

Thanks for any help. I'm familiar with programming, but not quite "advanced" outside of HTML variants and ActionScript, so I don't want to get too far just to muck it all up! I'm juuuust about to go buy a book if I can't figure it out myself, even though it's just for a friend. :)
 

Zugzwang152

Lifer
Oct 30, 2001
12,134
1
0
Originally posted by: LanceM
I gather the likely solution would be in PHP/MySQL, but I just wanted some suggestions before I get started (I've never really used PHP before aside from a small news script). I can't seem to find anything pre-written that wouldn't have to be completely torn down.

What I need is for a user (it doesn't necessarily need a login system) to be able to enter data into a few fields. A small example would be name, date, and total hours a project was worked on.

The output should be in a separate file available for an instructor-type user, in this format:
Name | Date | Hours

I can certainly get something like that up and running, but how much more work would it take to get this sortable by column headers?

Thanks for any help. I'm familiar with programming, but not quite "advanced" outside of HTML variants and ActionScript, so I don't want to get too far just to muck it all up! I'm juuuust about to go buy a book if I can't figure it out myself, even though it's just for a friend. :)

Pretty easy to do. You'll populate the data into an array, and then use a function like this to sort them. Then all you have to do is spit them out in order. There's many ways to sort things, and PHP itself has many different sort functions.