select

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi and thank you,
is there a reason this will not work? i am trying to echo an option that has already been selected in a list menu. best, addison



<select name="property">
<?
$obj = mysql_db_query($dbname,"select * from ads where id=$id;");
while($row = mysql_fetch_object($obj))
{
if ($row->property_type == $row->id)
{
$selected = "SELECTED";
} else {
$selected = "";
}
?>
<option value="<? echo $row->id; ?>" <? echo $selected; ?> selected>
<? echo $row->property_type; ?>
</option>
<option value="house">house</option>
<option value="condo">condo</option>
<option value="duplex">duplex</option>
<option value="apartment">apartment</option>
<option value="land">land</option>
</select>
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
addison@bellsouth.net
info@smipco.com
subsidiaries of small independent publishing co.
info@gloabaldog.com
info@momandpocentral.com

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux