2
Colleagues.
I have a select from which the data comes from a database. See:
public function verSelect($tabela,$idTB,$nomeTB,$nomeSelect){
$query = "SELECT * FROM ".$tabela;
// echo $query;
$sqlSelect = mysqli_query($this->conexao,$query);
$select = "<select name='".$nomeSelect."' class='form-control' id='selecionar'>";
$select .= "<option value='selecione'>Selecione</option>";
while($jmSelect = mysqli_fetch_object($sqlSelect)){
$select .= "<option value='".$jmSelect->$idTB."'>".$jmSelect->$nomeTB."</option>";
}
$select .= "</select>";
return $select;
}
Cool, cool, so far so good. But I need to make sure that when selecting an item of this select, a div appears with the contents of another table that is already related. For example: Let’s assume that I choose Fernando Pessoa in this select, it would automatically appear the div with the word poet from another table.
Remember that the table already exists and is populated with information, just need the mechanics in Javascript or jquery how to do this.
I could put your project’s html?
– Filipe Teixeira
Actually in html I only mention the PHP of which I bring the method quoted. I have nothing defined to bring the result I want.
– user24136