0
Good afternoon guys, I’m developing a code.
I need to get a value to register it as fkid of a table.
I have that part of the code:
<td><h3>Vincular Conteudo</h3></td>
<td colspan="2"><select name="tipoConteudo" class="form-control">
<?php
$tipoConteudo = new ConteudoDAO($conexao);
foreach($tipoConteudo->listaNomeConteudo() as $tipo) :
?>
<option value="<?=$tipo['nomeConteudo']?>">
<?=$tipo['nomeConteudo']; ?>
</option>
<?php
endforeach
?>
This part of the code works perfectly. It demonstrates a dropdown of what I need. But I need to send the id linked to the "Conteur name", which belongs to the table content. I will demonstrate the function listNomeConteud below:
function listaNomeConteudo() {
$conteudos = array();
$query = "select * from conteudo";
$resultado = mysqli_query($this->conexao, $query);
while($conteudo = mysqli_fetch_assoc($resultado)){
array_push($conteudos, $conteudo);
}
return $conteudos;
}
All I need to do is take the line ID nameConteud, and link to a new table like fkid.
Could anyone help me? Thank you
Note that when I try to get the value per post of typeConteud, it returns only "ARRAY"
– André Molinari