Sorting data

They have: 25 posts

Joined: Nov 2002

On my site I have a list of job openings for our company. I want to make it possible to sort the list by the position, the state, or the type of job. If they are looking for physical therapist positions only, I'd like only those options listed. (That would be the ideal thing.)

But, I would also take just listing all the postions on the page put have the physical therapist positions listed first.

I know a little javascript and a little php, but not much. I am hoping this will not be too complicated. I have searched around and can't find any help.
A simple script or any suggestions would be greatly appreciated.
Thanks!

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

If you're using a database, it's very easy to pull the results out in different orders (or have a search "engine").

Depends on how your data is set up on what kind of searching you can do with it.

They have: 25 posts

Joined: Nov 2002

The information is very minimal, but If I can pull info from excel or access, that would be great.

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

I'm out of my depth with excel or access, but I'm sure it can be done. Basically what I do is have little icons for sorting, at the top of the columns, and have them as forms or as hyperlinks to page that runs the queries based on the variable information you send.

So if you want to sort by last name descending, you'd send that information to the function page and it would send the right query string to the database to get the result.

If you have a set list of fields, you could have them in a drop-down form with a "search for all positions in this field". It would be possible to generate that from the database as well.

In order to do it smoothly and without future maintenance on your part short of entering in the job descriptions/positions in the first place, you'd have to plan the database and make it make sense.

For someone who knows what they are doing with Access (Excel is not a database, though people do use it as one), it shouldn't be very difficult.

They have: 25 posts

Joined: Nov 2002

Can you point me in a direction where I can get some data samples and scripting samples?

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Data samples would come from you. Database samples depend on the database/scripting language you're choosing.

It sounds like you're on a windows server, and would only have Access/Excel and ASP at your disposal?

They have: 93 posts

Joined: Jun 2003

Well if you using a windows box, and you can prived the database design scheme, we can help you with the query as Access does accept standard SQL, however how to query it with a language is ASP is beyond me.

It can be done in PHP with arrays and sorting, but no where a clean, correct, efficient, or quickly as pulling from a database.

I did a google search and found this for you.

http://www.webwizguide.info/asp/tutorials/connecting_to_a_database.asp

[Design Alpha] -Web Services : Design,Hosting,Advertising,Software
Ask about custom pricing on hosting!!
Site Assets: [UltraGaming.com] [Blades of Warcraft]

They have: 461 posts

Joined: Jul 2003

what lang are you looking to do it in? php has something called pear, which will convert between any sql as well as access.and there are things for access specifically. i don't know them, but php.net would be a good start.

if you have it saved in a csv (excel can export as such) and you do not have commas in the text itself, then it's simple. use php: explode()
that will make an array of the link, so you end up with a 2d array and you know the format and suchso the manipulation hould be minimal

if you don't already have a db, since mysql with php is extremely popular, i'd suggest that

POSIX. because a stable os that doesn't have memory leaks and isn't buggy is always good.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.