1
I have no idea how to proceed in this case
Summarizing accurate in 2nd dropdown list data related to the result of the first
In the case of the script below it shows the companies and users belonging to them
1º Select: List companies and get the Id of the selected
<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>
2º Select: Capiture the ID of the 1st Select 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>
You mean when you load the page one of the selects is filled in and you want the other to be filled in after the first one has been selected? you know how to use ajax?
– Sergio
Yes when selecting the company x logo already show all its users in the second dropdown.
– Fabio Henrique
you know what it is and how to use ajax?
– Sergio
No I know how to use ajax only PHP
– Fabio Henrique
Take a look here: http://answall.com/a/10766/129 meanwhile
– Sergio
It would be like two state selects one and the other blank. Qnd to choose the state in the other appear the cities
– Thalles Daniel