how to get the select option value and use it in a select statement

Discussion in 'PHP' started by rexicon, Sep 8, 2009.

  1. #1
    here's the scenario.

    ex.

    <select>
    $query = select * from table1;
    $conn=db_connect(); //db connection
    $result=oci_parse($conn, $query);
    oci_execute($result);
    while ($row = oci_fetch_arrary($result))
    {
    <option value=$row['column1']> .row['column2']. </option>
    }
    </select>

    the value of the selected option will be used by another query to filter the next select option.

    how do i reuse or store it to a variable within the same form.

    Thanks.

    Rexicon.
     
    rexicon, Sep 8, 2009 IP
  2. phprightnow

    phprightnow Peon

    Messages:
    296
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Why not just store the $_POST value of the select box in an type="hidden" input?

    Maybe I just don't understand what you're getting at. Your PHP there looks completely invalid.
     
    phprightnow, Sep 9, 2009 IP
  3. rexicon

    rexicon Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Im using php oracle. I have multiple select option in one form, the value of my first select option will be used to filter my second select option so that the second select option values will be related to the first select option.
     
    rexicon, Sep 9, 2009 IP