0

I have a database which got about 50 000 records. all is information of business partners.

I currently using

<select name="selection">
-- some while loop
<option></option> (repeat about 50,000 times)
-- end while loop
</select>

The issue is whenever I click on my dropdown, my browser will hang and crash. I think the records are too much.

For such cases, what is the best recommended implementation that can allow user to choose from the list of choice that is retrieve from database (about 50,000 choices) .

I need to do a form post to retrieve the ID of the selected option.

  • This question has two parts - one is implementation (which obviously fails) and is outside the scope of this forum. The other part is how best to display so much information - which is part of this forum. – Mayo Mar 1 '16 at 19:21
  • Some context around what type of data you're displaying would really help give a good answer, since you're likely going to have to group. Understanding how the data might naturally group is typically the first step in a problem like this – justin Mar 1 '16 at 19:55
  • If you like my answer, please select it. Thanks :) – invot Mar 8 '16 at 22:31
3

You need to be able to filter the data before you present it. Either have them select a category before a drop-down is populated, have an autocompelte that submits a query after a certain number of characters are entered in, or both.

Also, consider paging the information.

Too much data is too much data, no matter how you present it. So filter it before you show it to the user.

1

Clearly there is too much information there. Even if the browser wouldn't hang that is much too much information to display.

One way or another you need to break the information down into reasonable chunks. As this is a list of business partners the obvious first choices are grouping by location and by name. Examples below.

Hopefully there are other ways to group the information as well such as by type of partner.

You can, if necessary, mix and match. Have users filter first by type and then filter by name.

Select By Region:
   North America
   Europe
   Asia
   ...

or

Select By Name:
  A
  B
  C
  ...
  X
  Y
  Z

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.