Page 1 of 1

HELP~ arghhhh doh!~

Posted: Fri Jun 15, 2007 2:24 pm
by revocause
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

Posted: Fri Jun 15, 2007 3:01 pm
by Christopher
User the "multiple" attribute for <select>

hmm

Posted: Fri Jun 15, 2007 3:15 pm
by revocause
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?

Posted: Fri Jun 15, 2007 3:21 pm
by Christopher
Use OR in your WHERE clause?

like this

Posted: Fri Jun 15, 2007 4:03 pm
by revocause
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>

Posted: Fri Jun 15, 2007 4:49 pm
by Christopher
I don't see a query there and I can barely understand what that code is doing because of the formatting. And why are you using mysql_data_seek()?

Descriptive subjects

Posted: Fri Jun 15, 2007 4:53 pm
by feyd
Completely vague thread titles beget
[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.
edit: this is a duplicate. :? Strike one.