the problem is the menu can't display the value when I click the edit button from the previous form.
I know the the text field is <value="<? echo $name ?>"> but how about the menu? <select name="State" value="<? echo $state ?>"> ??????
menu??
Moderator: General Moderators
Erm.... yeah
If you are using <select> drop down menus you will need to do something like this....
...hope that helps.
?>
If you are using <select> drop down menus you will need to do something like this....
Code: Select all
<select name="state" size=1>
<option value="NY" <?php if(isset($state)&&$state=='NY'){echo('selected');} ?>>NY</option>
<option value="LA" <?php if(isset($state)&&$state=='LA'){echo('selected');} ?>>NY</option>
</select>...hope that helps.
?>
it sure can! you just do the two queries!
Code: Select all
<?php
MYSQL_QUERY("INSERT INTO `b` (field, field2) VALUES ('$field', '$field2')") or die( "Could not write information. Reason: ". mysql_error() );
MYSQL_QUERY("DELETE FROM `a`") or die(mysql_error());
?>