I have a select menu and in one of the options, i need it to have multiple values. Is that possible?
If not whats the best way to go about that?
so say for example you have
<select>
<option > Item A </option>
<option > Item B </option>
<option > Item C </option>
<option > Item D </option>
and say the user selects Item A.
and if Item A has attributes of = weight, price, quantity (in Item A package).
The database is created with the weight , price, quantity for Item A
But how do i query it all from one selected option?!
Thank ya
HELP~ arghhhh doh!~
Moderator: General Moderators
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
hmm
i didnt mean to have more than one option selected.
I mean where one option itself , will make 3 queries to database to get 3 different attributes.
the MULTIPLE only lets me select more tha none option is all right?
so how can i make it if say <option> Item A </option> is selected,
then it will make a query to database to get THREE attributes from the table not just one.
in DreamWeaver and most webforums etc they talk about how to set the value to query a database , thats simple enough.
But how do i query the databse for THREE attributes.
you select Item A.
it then makes 3 seperate queries to the database pulling Item A's = weight, price, quantity.
how do i do that with a select menu like this?
I mean where one option itself , will make 3 queries to database to get 3 different attributes.
the MULTIPLE only lets me select more tha none option is all right?
so how can i make it if say <option> Item A </option> is selected,
then it will make a query to database to get THREE attributes from the table not just one.
in DreamWeaver and most webforums etc they talk about how to set the value to query a database , thats simple enough.
But how do i query the databse for THREE attributes.
you select Item A.
it then makes 3 seperate queries to the database pulling Item A's = weight, price, quantity.
how do i do that with a select menu like this?
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
like this
so in the regular query that looks like this
Code: Select all
<option value="<?php echo $row_Recordset1['baseprice']?>"<?php if (!(strcmp($row_Recordset1['baseprice'], $row_Recordset1['weight']))) {echo "SELECTED";} ?>><?php echo $row_Recordset1['quantity']?></option>
<?php
} while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));
$rows = mysql_num_rows($Recordset1);
if($rows > 0) {
mysql_data_seek($Recordset1, 0);
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
}
?>
</select>- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Descriptive subjects
Completely vague thread titles beget
Strike one.
edit: this is a duplicate.[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:2. Use descriptive subjects when you start a new thread. Vague titles such as "Help!", "Why?" are misleading and keep you from receiving an answer to your question.