CallumJohnson
08-10-2010, 01:54 PM
Hey,
I have this code:
<?php
echo '<select name="user_banks" class="grey_tbox">';
$sql = ("SELECT * FROM ".TBL_USERPROPBANKS."");
$query = $database->query($sql);
while($bank = mysql_fetch_array($query)){
echo '<option value="'.$bank['prop_id'].'">'.$bank['prop_name'].' ('.$bank['prop_t_rate'].'%)</option>';
}
echo '</select>';
?>
It gets data from my MySQL table and populates the select menu.
However, I want it to populate the position of each row in the select menu randomly.
e.g. the top select row isn't always value =1
I'm a bit stumped on how to actually achieve this. Any ideas?
regards, Callum.
I have this code:
<?php
echo '<select name="user_banks" class="grey_tbox">';
$sql = ("SELECT * FROM ".TBL_USERPROPBANKS."");
$query = $database->query($sql);
while($bank = mysql_fetch_array($query)){
echo '<option value="'.$bank['prop_id'].'">'.$bank['prop_name'].' ('.$bank['prop_t_rate'].'%)</option>';
}
echo '</select>';
?>
It gets data from my MySQL table and populates the select menu.
However, I want it to populate the position of each row in the select menu randomly.
e.g. the top select row isn't always value =1
I'm a bit stumped on how to actually achieve this. Any ideas?
regards, Callum.