chrisuk Posted March 10, 2007 Share Posted March 10, 2007 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 Quote Link to comment Share on other sites More sharing options...
aniesh82 Posted March 10, 2007 Share Posted March 10, 2007 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 Quote Link to comment Share on other sites More sharing options...
chrisuk Posted March 11, 2007 Author Share Posted March 11, 2007 Hi, Thanks for that. Had to modify that slighty to get it working - so should be good from there!! Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.