phpmysqldatalist

PHP - big datalist option


I have function which show 70.000 option values in webpage, is there any option to do "autosuggestion"? Now there is the problem with performance, the browswere are crashed after 2 - 3 searches

while($row_ICAO = $airports_ICAO->fetch_assoc()) {

echo "<option value='{$row_ICAO['ICAO']}'></option>";
}

Maybe there is another option to do this and browsers won't crash?


Solution

  • @Dayek,

    I will prefer this. First don't fetch any data when form load. when user click on select2 input provide search functionality, when user start typing for search at that time you need to implement ajax call for fetch related data ( user type in select2 search input ) from database table. Please refer this link