Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8672967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:20:06+00:00 2026-06-12T19:20:06+00:00

I am trying to create a dropdown box where it has from 10 –

  • 0

I am trying to create a dropdown box where it has from 10 – 90, I want each value to stand for the numbers in between (so 10 will hold 11, 12, 13, 14.. and so on and so forth). So if a user clicks on 10 it will display any entries in a database that range from 10 – 19, not just entries with “10” in it.

Is it possible to add multiple values within an option tag? Here is what I have attempted so far.

HTML:

<body>


  <form action="form3.php" method="post">
  <label for ="description">Description:</label>
  <input type="text" name="descrip" /><br />

         <label for="trayheight">Height: </label>
                <select name="trayheight">
                    <option value="">All</option>
                    <option value="10">10</option>
                    <option value="[20:21:22:23:24:25:26:27:28:29]">20</option>
                    <option value="30">30</option>
                    <option value="40">40</option>
                    <option value="50">50</option>
                    <option value="60">60</option>
                    <option value="70">70</option>
                    <option value="80">10</option>
                    <option value="90">90</option>
                </select><br />

         <label for="trayrange">Trayrange: </label>
                <select name="trayrange">
                    <option value="">All</option>
                    <option value="BBQ">BBQ</option>
                    <option value="Dessert">Dessert</option>
                    <option value="Display">Display</option>
                    <option value="Meat">Meat</option>   
                    <option value="Microwave">Microwave</option>
                    <option value="Party">Party</option>
                    <option value="Salad/Wet Pasta">Salad/Wet Pasta</option>
                    <option value="Snacks">Snacks</option>
                    <option value="Standard">Standard</option>
                </select><br />

        <label for ="traytype">Traytype: </label> 
                <select name="traytype">
                    <option value="">All</option>
                    <option value="Open">Open</option>
                    <option value="Cavitised">Cavitised</option>
                    <option value="Lid">Lid</option>
                    <option value="Tray">Tray</option>
                    <option value="Coallition">Coallition</option>
                    <option value="Bowl">Bowl</option>
                    <option value="Hinge pack">Hinge pack</option>
                    <option value="Pot">Pot</option>
                    <option value="Base & Lid">Base and Lid</option>
                    <option value="Rectangular">Rectangular</option>
                    <option value="Specalist">Specialist</option>
                </select><br />

        <label for="trayshape">Trayshape: </label>
                <select name="trayshape">
                    <option value="">All</option>
                    <option value="Rectangular">Rectangular</option>
                    <option value="Oval">Oval</option>
                    <option value="Square">Square</option>
                    <option value="Insert">Insert</option>
                    <option value="Round">Round</option>
                    <option value="Open">Open</option>
            </select><br />
        <input type="submit" value="Submit" /> 
    </form> 

  </body>

PHP:

        <body>

        <?php
            $con = mysql_connect ("localhost", "root", "");
                   mysql_select_db ("delyn_db", $con);

            if (!$con)
                { 
                    die ("Could not connect: " . mysql_error());
                }

            $descrip = mysql_real_escape_string($_POST['descrip']); 
            $width   = mysql_real_escape_string($_POST['width']);
            $depth   = mysql_real_escape_string($_POST['depth']);

            $varHeight= mysql_real_escape_string($_POST['trayheight']);
            $varRange = mysql_real_escape_string($_POST['trayrange']);
            $varType  = mysql_real_escape_string($_POST['traytype']);
            $varShape = mysql_real_escape_string($_POST['trayshape']);
            $varImage = mysql_real_escape_string($_POST['imagename']);

            $sql = "SELECT * FROM delyn WHERE 
                        description LIKE '%".$descrip."%'  
                    AND trayheight LIKE '%".$varHeight."%'
                    AND trayrange LIKE '%".$varRange."%' 
                    AND traytype LIKE '%".$varType."%' 
                    AND trayshape LIKE '%".$varShape."%'";


            $r_query = mysql_query($sql);

                while ($row = mysql_fetch_array($r_query))
                    { 
                        echo '<br /> <img src="   '. $row['imagename'] . '" width="180" length="100">';
                        echo '<br /> Tool Code:   '. $row['toolcode'];
                        echo '<br /> Description: '. $row['description']; 
                        echo '<br /> Tray range:  '. $row['trayrange']; 
                        echo '<br /> Tray type:   '. $row['traytype'];
                        echo '<br /> Tray size:   '. $row['traysize']; 
                        echo '<br /> Tray shape:  '. $row['trayshape'] . '<br />' . '<br />';  
                    }

                if (mysql_num_rows($r_query) <= 0){
                    echo 'No results match your search, please try again';
               }


        ?>
    </body>

Thanks in advance anyone who can help 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T19:20:08+00:00Added an answer on June 12, 2026 at 7:20 pm

    Simple answer: you cannot store multiple values in one option tag value.

    The simplest and safest solution would be to store one value in the option value (e.g. 10) and then treat this as a range from the value set to the next multiple of 10:

    'AND col >= '.$value.' AND col < '.$value+10

    A second solution would be to set the value to be a range like 10-19 and then on the server side:

    list($min,$max) = explode('-',$value);
    ... 'AND col >= '.$min.' AND col <= '.$max ...
    

    Another solution would be to store a JSON encoding of an array containing the values you wish to encapsulate in the one option and then decode the value on the server side:

    'AND col IN ('.implode(',',json_decode($value)).')'

    I personally would avoid the JSON approach as it is overkill for this kind of problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a dropdown box that will render a label under certain
I am trying to create this dropdown box that slides down and has the
I am trying to create a drop down list box with the selected value
I am trying to create a dropdown menu that when you click it will
hi all im trying to load information from a table into a dropdown box.
I have been trying to find out how to create a dropdown box in
I'm trying to create a drop-down box with a few values. I don't want
So I am trying to create a dynamic form where the 2nd dropdown box
I'm trying to create a dropdown kind of menu.So on clicking on a div
I am trying to create a Dynamic Dropdown menu class which contains a class

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.