Hello,
I have a table (REPORT) whose primary key is a set of two values (Id_game + Id_player).
In a form I would like to have a SELECT tag where I could chose a row representing both values, and send both of them through the form.
Something like this:
<select name="report">
<option value="WHAT I WRITE HERE?"> <?php echo $game1; ?> - <?php echo $player1; ?></option>
<option value="WHAT I WRITE HERE?"> <?php echo $game1; ?> - <?php echo $player2; ?></option>
<option value="WHAT I WRITE HERE?"> <?php echo $game2; ?> - <?php echo $player1; ?></option>
<option value="WHAT I WRITE HERE?"> <?php echo $game1; ?> - <?php echo $player2; ?></option>
</select>
THANKS
Select tag returning two values
Moderator: General Moderators
- DigitalMind
- Forum Contributor
- Posts: 152
- Joined: Mon Sep 27, 2010 2:27 am
- Location: Ukraine, Kharkov
Re: Select tag returning two values
Maybe something like <option value="<?php echo $game1 . ',' . $player1 ?>"> ?
Re: Select tag returning two values
Yeah, I think this way will work. THANK YOU!
Re: Select tag returning two values
Perhaps value1,value2
and then explode it in php for your use?
and then explode it in php for your use?
- DigitalMind
- Forum Contributor
- Posts: 152
- Joined: Mon Sep 27, 2010 2:27 am
- Location: Ukraine, Kharkov
Re: Select tag returning two values
$game_player_values = explode(',', $_REQUEST['report']);
Re: Select tag returning two values
Yeah, that's what I was sayingDigitalMind wrote:$game_player_values = explode(',', $_REQUEST['report']);
Re: Select tag returning two values
Thank you all!!