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 Link to comment https://forums.phpfreaks.com/topic/42100-solved-can-you-read-a-value-into-a-list-menu/ 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 Link to comment https://forums.phpfreaks.com/topic/42100-solved-can-you-read-a-value-into-a-list-menu/#findComment-204278 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 Link to comment https://forums.phpfreaks.com/topic/42100-solved-can-you-read-a-value-into-a-list-menu/#findComment-204753 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.