I have a code that has to show a list of options downloaded from the database through the element. The problem is that this query takes a long time to load (since I have to show more than 150000 records).
The code I currently have is this:
<select name="a" class="form-control">
<option>Selecciona una opción</option>
<?php $res = mysql_unbuffered_query("SELECT HIGH_PRIORITY id, nombre FROM 'Tabla'");
while($row= @mysql_fetch_array($res)){?>
<option value="<?= $row['id']?>"><?= $row['nombre']?></option>
<?php } ?>
</select>
I thought about doing the query in the background but I do not know where to start.
If someone else has gone through the same situation, I would appreciate your comments.