Jump to content

[SOLVED] can you read a value into a list menu?


chrisuk

Recommended Posts

a system i am developing has both a user and an admin side.

 

The user can add a record and then the status of this is initially set to a fixed value.

 

What I am wondering is, if i stick with a list of say 4 possible status', how can i get whatever status the admin changes the record to to be "sticky" on the menu the next time he looks at the call, as opposed to the menu showing the default value set in dreamweaver??

 

Thanks

 

Hello

 

Suppose that the field name in the table with the status is "status"..

 

In your code you want to get selected the value from table...Isn't it right ?

 

$result = "select * from table name ";

 

$data = mysql_fetch_array[$result];

 

  ?>

<select >

<? if($data['status'] == "value1" ) {  ?>

<option value="value1" selected></option>

<? } else { <option value="value1" selected></option> <? } ?>

 

## Apply this logic to your select menu.

</select>

 

<?

 

Regards

Aniesh Joseph

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.