SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Feb 2005
    Posts
    175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Related drop-down menu

    I have a webpage who's taking data from a mysql DB

    For now on I will have only two dynamic input form object.

    A drop down-menu that look through the city available.
    And a second drop-down menu that show the dates available.

    My db is quite short ;
    PHP Code:
     $Ville $row['Ville'];
             
    $Date1 $row['Date1'];
             
    $Date2 $row['Date2'];
             
    $Derniermodif $row['Derniermodif'];
             
    $DocId $row['DocId']; 
    For now on the city appear alright.

    PHP Code:
    <tr>
    <td width="290"><select name="Ville">Lieu de la formation: <?php while ($choixVille mysql_fetch_assoc($resultat)) {
                                    echo 
    "<OPTION VALUE '" .$DocId["DocId"]."'>".$choixVille["Ville"];
                                    }
                                    
    ?></select></td>
    But I'm not shure how to get the related Date 1 and 2 for the second drop-down.

    Each city have 2 date available.

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    $sql "SELECT Date1, Date2 FROM table WHERE DocId = " $_POST['DocId']; 

  3. #3
    SitePoint Zealot
    Join Date
    Apr 2005
    Location
    Helsingborg, Sweden
    Posts
    168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dan Grossman
    PHP Code:
    $sql "SELECT Date1, Date2 FROM table WHERE DocId = " $_POST['DocId']; 
    Shouldn't that be:
    PHP Code:
    $sql "SELECT Date1, Date2 FROM table WHERE DocId = " $_POST['Ville']; 
    ?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •