"php dropdow menu ": update a second list select from first choise

Hello everyone; thankyou for this forum.
I create a DB "koko" and one table "local" witch contains two colomns , nomlocal and NomBatiment, on total 500 records--> nomlocal and 10 records NomBatiment which are repeated for other local.
if someone can help me to create a menu dropdown when i select NomBatiment on the first select menu on the second can see just local.NomBatiment=local.nonlocal "second menu autoupdate from first select";

Thanks thanks.....

<SCRIPT language=JavaScript>
function reload(form){
var val=form.cat.options[form.cat.options.selectedIndex].value;
self.location='local.php?cat=' + val ;


$db5 = mysql_connect('localhost', 'root', '');

$req2 = mysql_query("SELECT NomBatiment FROM local group by NomBatiment");


while ($row = mysql_fetch_array($req2))

$batiment.="<OPTION VALUE=\"$nom\">".$nom.'</option>';


<select NAME=NomBatiment onchange=\"reload(this.form)\"><option VALUE=0><?php echo $batiment?> </select>


$db3 = mysql_connect('localhost', 'root', '');


$req5 = mysql_query("SELECT nomlocal FROM local");


while ($row5 = mysql_fetch_array($req5))


$local5.="<OPTION VALUE=\"$nom3\">".$nom3.'</option>';


<select NAME=nomlocal><option VALUE=0><?php echo $local5?></select>

Please Login to post your reply or start a new topic