Sorting SQL information with PHP

Hi,

Ive just have a quick query. On this web page of mine http://www.whenmonstersattack.com/seeanddo I have lots of enteries sorted by catergory. The thing is instead of having them all listed in a big table I would prefer that the user would click on a ‘Gallery’ text hyperlink and then only the gallery enteries would show in ascending order either by name or ‘id’ number.

Ive seen this sort of thing done before in things like scoreboards where you can just show the top 10 or top 100 or sort by names or score. Im just wondering if it can be done for this type of thing.

Would I be right (half right) in thinking it would look something like this?
Code:

<a href="../seeanddo/index.php?catergory=gallery">Show all Galleries</a>

I do want it all contained on the one index page.

I have a table which contains HTML to display pictures, animations and movie. Each entry has an unique id number and a category.

I want to have a list of all the categories on one side ie Gallery, Animation, Movie and then when the user clicks on the Animation hyperlink all the enteries in the table that have a category = to Animation will be displayed in the right hand column. Then if they clicked on the Movie text only all the Movie enteries will be shown.

But I want this all to happen on one PHP page. At the moment I could create normal HTML links and an iframe, but I dont want too!

Thanks for any help!