# How would I setup a while loop to dump the $prices array into select html tags?

**URL:** <https://forum.kirupa.com/t/how-would-i-setup-a-while-loop-to-dump-the-prices-array-into-select-html-tags/242601>\
**Category:** Uncategorized\
**Created:** [October 28, 2007, 12:36pm UTC](https://forum.kirupa.com/t/how-would-i-setup-a-while-loop-to-dump-the-prices-array-into-select-html-tags/242601 "2007-10-28T12:36:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pp4sale](https://avatars.discourse-cdn.com/v4/letter/p/ee7513/32.png) [@pp4sale](https://forum.kirupa.com/u/pp4sale)\
**Post date:** [October 28, 2007, 12:36pm UTC](https://forum.kirupa.com/t/how-would-i-setup-a-while-loop-to-dump-the-prices-array-into-select-html-tags/242601/1 "2007-10-28T12:36:04Z")

</div>

[COLOR=#000000][COLOR=#0000bb][/COLOR][FONT=Courier New][COLOR=#ff8000][COLOR=black]Can anyone tell me how I would[FONT=Verdana] setup a while loop to dump the $prices array into my select html tags?[/FONT][/COLOR][/COLOR][/FONT][/COLOR]  
[COLOR=#000000][FONT=Courier New][COLOR=black][COLOR=#ff8000][/COLOR][/COLOR][/FONT][/COLOR]  
[COLOR=#000000][FONT=Courier New][COLOR=black][COLOR=#ff8000]//create the Price Minimum menu  
[/COLOR][COLOR=#0000bb]$MinPrice [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"\<select name=MinPrice\>  
\<option value=""\>Minimum\</option\>  
"[/COLOR][/COLOR][/FONT][COLOR=#007700][COLOR=black][FONT=Courier New];[/FONT]  
[/COLOR][/COLOR][/COLOR]  
[COLOR=black]$MinPrice = 10;  
$MaxPrice = 100000;

$q1 = “SELECT Price FROM re\_listings WHERE Price BETWEEN ‘$MinPrice’ AND ‘$MaxPrice’”;  
$r1 = mysql\_query($q1) or die(mysql\_error());

if(mysql\_num\_rows($r1) \> 0) {  
while($a1 = mysql\_fetch\_array($r1)) {  
$prices[] .= **$a1[‘Price’];**  
}  
}  
[/COLOR][FONT=Courier New][COLOR=black][COLOR=#0000bb]$MinPrice [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#0000bb]$prices[/COLOR][COLOR=#007700].[/COLOR][COLOR=#dd0000]"\</select\>  
“[/COLOR][/COLOR][/FONT][COLOR=#007700][FONT=Courier New][COLOR=black];[/COLOR][/FONT][/COLOR]  
[COLOR=#007700][FONT=Courier New][COLOR=black]  
[/COLOR][/FONT][/COLOR][FONT=Courier New][COLOR=black][COLOR=#ff8000]//create the max price menu  
[/COLOR][COLOR=#0000bb]$MaxPrice [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]”\<select name=MaxPrice\>  
\<option value=""\>Maximum\</option\>  
“[/COLOR][/COLOR][/FONT][FONT=Courier New][COLOR=black][COLOR=#007700];  
[/COLOR][COLOR=#0000bb]$MaxPrice [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#0000bb]$prices[/COLOR][COLOR=#007700].[/COLOR][COLOR=#dd0000]”\</select\>  
"[/COLOR][/COLOR][/FONT][COLOR=#007700][COLOR=black][FONT=Courier New]; [/FONT]  
[/COLOR][/COLOR][COLOR=black]  
Thanks!!![/COLOR]
