<?php

// ------------------------------------------------------------------------- //
// Génère une liste déroulante à partir des éléments d'une table.            //
// ------------------------------------------------------------------------- //
// Auteur: wirus                                                             //
// Email:  tltran@gameloft.com                                               //
// Web:    http://www.gameloft.com                                           //
// ------------------------------------------------------------------------- //

$cnx = odbc_connect($DSN, $user, $pass);

$sqlstr = "SELECT id,countryname FROM Table_Country";
$resid = odbc_exec($cnx, $sqlstr);

echo
"<select name=\"pays\">";

while (
odbc_fetch($resid)) {
  
$id = odbc_result($resid, 1);
  
$country = odbc_result($resid, 2);

  echo
"<option value=$id>$country";
}

echo
"</select>";

?>