Personal wave I have no idea how to proceed in this case
Summarizing accurate 2nd dropdown list data related to the result of the first
In the case of the script below it shows the companies and the users belonging to them
1st Select: List companies and get the selected Id
<select name="empresa" style="width: 160px;" required>
$sql = "SELECT * FROM empresas WHERE id_transfer = '$id_transfer'";
$resultado = mysql_query($sql) or die( mysql_error());
while ($linha = mysql_fetch_assoc($resultado)) {
$id_empresa = $linha["id_empresa"];
$nome = $linha["nome_fan"];
<option value="<?echo $id?>"><?echo $nome?></option>
<?}?>
</select>
2nd Select: Capture the 1st Select ID and show the results belonging to them
<select name="user_soli" style="width: 160px;" required >
<option value=""></option>
<?
$sql = "SELECT * FROM usuarios WHERE id_user = '$id_empresa'";
$resultado = mysql_query($sql) or die( mysql_error());
while ($linha = mysql_fetch_assoc($resultado)) {
$id = $linha["id_empresa"];
$nome = $linha["nome_fan"];
?>
<option value="<?echo $id?>"><?echo $nome?></option>
<?}?>
</select>