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

Link to comment
Share on other sites

 

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.