Page 1 of 1
menu??
Posted: Sun Jul 13, 2003 10:23 am
by superman
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 ?>"> ??????
Posted: Sun Jul 13, 2003 1:20 pm
by Gen-ik
Erm.... yeah
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.
?>
Posted: Sun Jul 13, 2003 10:54 pm
by superman
thanx a lot, i've solved the problem.
can php run two queries at the same time?
for example, i insert the record to the table B, then delete from the table A.
Posted: Mon Jul 14, 2003 1:19 am
by Drachlen
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());
?>