Posted by David Haynes on 03/26/06 05:47
Zorro wrote:
> Yes, you are correct. After the post, I know the value (ex : H ) and I need
> the text also. Then I do a SELECT col2 FROM myTable WHERE COL1 = 'H'
>
> I wanted to avoid doing this query by passing both the value and the text
> through the post.
>
> Denis
>
> "rlee0001" <robeddielee@hotmail.com> a écrit dans le message de news:
> 1143288409.220675.136750@g10g2000cwb.googlegroups.com...
>> Let me make sure I understand the problem correctly.
>>
>> Your table in your database looks like this?:
>>
>> COL1 COL2
>> H Hello
>> G Good-Bye
>>
>> And you are using Col1 (H or G) as a key into the table and you want to
>> know how to read the other columns from the table when the form is
>> submitted? Is that correct?
>>
>> -Robert
>>
>
>
<form action="foo.php" method="POST">
<select name="foo">
<option value="G:Good-Bye">G</option>
<option value="H:Hello">H</option>
</select>
</form>
[foo.php]
<?php
if( isset($_POST['foo'] ) {
$values = explode(':', $_POST['foo']);
$col1 = $values[0];
$col2 = $values[1];
}
?>
Is this what you wanted?
-david-
Navigation:
[Reply to this message]
|