Jump to content

option box mysql data field "selected"


sungpeng

Recommended Posts

$result = mysql_query("SELECT * FROM listings where rid='$rid'");
$row = mysql_fetch_array($result);


<SELECT name="address" [b]value="<?php echo"$row[title]"; ?>" [/b]  selected> 
<OPTION value="" >Any</OPTION> 
<OPTION value="Ang Mo Kio">Ang Mo Kio</OPTION> 
<OPTION value="Ayer Rajah Estate">Ayer Rajah Estate</OPTION> 
<OPTION value="Bedok">Bedok</OPTION> 
</select>

 

Check I need the selected form option box to be mysql data field "selected". Can help modify above code to make it work?

Link to comment
https://forums.phpfreaks.com/topic/155153-option-box-mysql-data-field-selected/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.