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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DropDown or Array Help

Status
Not open for further replies.

zrazzaq

MIS
Apr 13, 2005
102
US
Hi:
I have a function called college_dropdown in PHP. The issue is the select/option statement list out all the colleges in US for example:
Code:
<OPTION VALUE="A CUT ABOVE BEAUTY COLLEGE">A CUT ABOVE BEAUTY COLLEGE</OPTION>
<OPTION VALUE="A T STILL UNIVERSITY OF HEALTH SCIENCES">A T STILL UNIVERSITY OF HEALTH SCIENCES</OPTION>
<OPTION VALUE="A1 BUSINESS AND TECHNICAL COLLEGE">A1 BUSINESS AND TECHNICAL COLLEGE</OPTION>
I have 6750 colleges to list out. When I load my page it takes about 2 minutes to load it.
Should I place it in a table called college and load the page that way. How do I do that in PHP or should I use an array in php?
Any suggestions
Thanks
Zishan
 
You're not going to get better speed than with static HTML.

What I might suggest is breaking up the list so that all 650 colleges don't have to be in the <SELECT> at once. That way, you reduce the data overhead on the initial page load.

Perhaps have one dropdown which has groups of letters of the alphabet, and when one is selected (say, "A-C"), the page is refreshed with the dropdown populated with only the appropriately-named colleges.



Want the best answers? Ask the best questions! TANSTAAFL!
 
Or groups of college types, or groups of colleges by location...

All would produce better results, if using a db, you can then display by location and type making a shortlist much easier.

You can skin a cat in many ways, this PHP forum, however will also ask what you'd like to use to skin it with, and what colour it should be afterwards :D

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Awesome ideas, Anyone got a example of having letters and then the page refreshing and getting the colleges that correspond to those letters. I mean the code behind it?
Thanks
Zishan
 
or how about a web-combo box using ajax. sounds like a perfect occasion for such a thing!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top