I m using this code to be able to generate an dynamic select: demo: http://www.erichynds.com/examples/jquery-related-selects code: https://github.com/ehynds/jquery-related-selects
我已经从以下几处修改了国文法:
$counties = array();
$counties[ 1 ][ BARN ] = Barnstable ;
$counties[ 1 ][ PLYM ] = Plymouth ;
$counties[ 2 ][ CHIT ] = Chittenden ;
$counties[ 3 ][ ANDE ] = Anderson ;
To
$counties = array();
$sql = "SELECT
id,
naam,
klant_id
FROM contactpersoon
ORDER BY klant_id ASC ";
if(!$res = mysql_query($sql,$con))
{
trigger_error(mysql_error(). <br />In query: .$sql);
}
else
{
while ($row = mysql_fetch_array($res))
{
$counties[$row[ klant_id ][$row[ id ] = htmlentities($row[ naam ]);
}
}
But for some reason the pulldown select list is not created when the changes are made. When I test the query, no errors shown.