1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
   |  
<?php
function select($requete, $var1, $var2, $var3) {
        //global ;
        $chauf = mysql_query($requete) or die(mysql_error());
        $row_chauf = mysql_fetch_assoc($chauf);
        $totalRows_chauf = mysql_num_rows($chauf);
        
 
        echo "<select name=\"".$var2."\">\n";
        do {
        echo "<option value=\"$row_chauf[$var3]\">".$row_chauf["$var3"]."</option>\n";
 
        } while ($row_chauf = mysql_fetch_assoc($chauf));
          $rows = mysql_num_rows($chauf);
          if($rows > 0) {
                  mysql_data_seek($chauf, 0);
                  $row_chauf = mysql_fetch_assoc($chauf);
          }
        echo "</select>\n";
}
?>
<?php
select("SELECT * FROM parcelle", "par", "sous_parcelle","sous_parcelle");
?> | 
Partager