Listbox and mysql value

tralrypep

New Member
I am tring to have the selected number showing on the listbox as default.In the follow database i haveDatabase Name: ratingsID ---------------- Rating1 ---------------- 4in my list box i have 1 - 10 i want to be able to show the Rating from the database but i want it to display it as default and when you click on the list box it got 1 - 10\[code\]$query = "SELECT Rating FROM ratings"; $result = mysql_query($query); print "<SELECT name=item>"; while ($line = mysql_fetch_array($result)) { foreach ($line as $value) { print "<OPTION value='http://stackoverflow.com/questions/3843820/$value'"; } print ">$value</OPTION>"; }\[/code\]Thank you
 
Back
Top