Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sort by category and print

Status
Not open for further replies.

envar

Technical User
Jan 5, 2002
2
US
I have the following db stored similar to:

name:pete|listas:blue|uniqueid:567|age:20
name:ruth|listas:red|uniqueid:688|age:50
name:joe|listas:blue|uniqueid:99|age:25

(with many more fields than what is shown)

Normally, the data is displayed doing a foreach by unique ID. But I want to sort the data records by the listas field. So, for any person who used "blue" in the listas field, the list would read as so:

blue:
joe id 99 age 25
pete id 567 age 20

red:
ruth id 688 age 50

I use this as an SSI call from an HTML page. It works fine when going by uniqueid because it is a simple "foreach' statement after getting each field record into a hash.

What I cannot make work is getting the 'listas' field to become the unique id, and then list all records containing the same 'listas' field under it without listing the 'listas' field over and over and over.

The simpler - the better.

Thanks for any help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top