Debes usar un select principal que va a la la base de datos.
Y los select restantes van asociados a un javascript y un php de la siguiente, manera.
<form id="form1" name="form1" method="POST" action="armarios2.php">
<table align="center">
<tr valign="baseline">
<td valign="baseline">Departamento</td>
<td valign="baseline"><select name="select1" id="select1">
<?php
do {
?>
<option value="<?php echo $row_actividad['depacodi']?>"><?php echo $row_actividad['depadesc']?></option>
<?php
} while ($row_actividad = mysql_fetch_assoc($actividad));
$rows = mysql_num_rows($actividad);
if($rows > 0) {
mysql_data_seek($actividad, 0);
$row_actividad = mysql_fetch_assoc($actividad);
}
?>
</select></td>
</tr>
<tr valign="baseline">
<td valign="baseline">Ciudad</td>
<td valign="baseline"><select name="select2" id="select2">
<option>seleccione</option>
</select></td>
</tr>
<tr valign="baseline">
<td valign="baseline">Distrito</td>
<td valign="baseline"><select name="select3" id="select3">
<option>Seleccione</option>
</select></td>
</tr>
<tr valign="baseline">
<td valign="baseline"> </td>
<td valign="baseline"><input name="submit" type="submit" value="Consultar" /></td>
</tr>
</table>
<p>
<label></label>
</p>
</form>
<script type="text/javascript" src="popcalendar.js"></script>
<!-- InstanceEndEditable --></td>
<td width="235"><p align="center"> </p></td>
</tr>
</table>
<table width="907" border="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table>
<p> </p></td>
</tr>
</table>
</div>
</body>
<!-- InstanceEnd --></html>
<?php
mysql_free_result($actividad);
mysql_free_result($supervisores);
?>
el java script
<script type="text/javascript" src="jquery.js"></script>
<script language="JavaScript" type="text/JavaScript">
$(document).ready(function(){
//INICIANDO
$("#select1").change(function(event){
var id = $("#select1").find(':selected').val();
$("#select2").load('selector.php?padre='+id);
})
})
</script>
<script language="JavaScript" type="text/JavaScript">
$(document).ready(function(){
//INICIANDO
$("#select2").change(function(event){
var id = $("#select2").find(':selected').val();
$("#select3").load('selector3.php?padre='+id);
})
})
</script>
el php
$varPadre_Recordset1 = $_GET["padre"];
if (isset($_GET["padre"])) {
$varPadre_Recordset1 = $_GET["padre"];
}
mysql_select_db($database_sico, $sico);
$query_Recordset1 = sprintf("SELECT * FROM localida WHERE localida.locadepa= %s", GetSQLValueString($varPadre_Recordset1, "int"));
$Recordset1 = mysql_query($query_Recordset1, $sico) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<?php do {
echo '<option value="'.$row_Recordset1['locacodi'].'">'.$row_Recordset1['locadesc'].'</option>'
?>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
<?php if ($totalRows_Recordset1 == 0) { // Show if recordset empty ?>
no hay nada
<?php } // Show if recordset empty ?>
<p>
<?php
mysql_free_result($Recordset1);
?>
</p>
<?php if ($totalRows_Recordset1 > 0) { // Show if recordset not empty ?>
<p>si hay</p>
<?php } // Show if recordset not empty ?>