I'm trying and can not do the following:
I thought of "automating" the process of reports of the system that I am doing, by registering the PRODUCT, you also register the name of the column id and the name of the product id, as follows:
Thatway,IgetthroughGETtodefinewhichtable,idcolumn,andproductnameIhavetopull.Forthis,IplayalltheinformationintheURL:
Sowhenthepersonclicksontheproduct,IalreadyhavealltheinformationIneed(whichtableIneedtogettheinformation,etc)throughthecodebelow:
<?php$produtos=listaProdutos($conexao);$tabela=$_GET['tabela'];$coluna=$_GET['coluna'];$modelo_produto=$_GET['modelo_produto'];$produtos_id_produto=$_GET['produtos_id_produto'];$nome_produto=$_GET['nome_produto'];$sigla_produto=$_GET['sigla_produto'];?><table><tr><td><h3>Qualmodelode<?=$nome_produto?>vocêdesejaanunciar?</h3></td></tr></table><tdwidth="250px" id="anuncios" name="anuncios">
<?php
$anuncio= mysqli_query($conexao,"SELECT * FROM $tabela order by $modelo_produto");
echo "<select class='btn btn-link' name='anuncios' id='anuncios'>";
while($reg = mysqli_fetch_object($anuncio)){
echo "<option value='$reg->coluna'>$reg->modelo_produto</option>";
}
echo "</select>";
?> </td>
<table>
<tr>
</tr>
</table>
And here comes the problem, in% with% I can select what I want through GET with the $ table (which informs the table that it has to pull the information).
It even works, but at the time of displaying, it does not show the names:
Beingthatinthetablethatmustbeselected(batteries)areallvalues:
IthinkhecannotfindthecorrectfieldthroughtheGETthatshouldappear,whichinthiscaseisSELECT
IneedsuggestionsonhowIcanechothe"template_file" field.
echo "<option value='$reg->coluna'>$reg->modelo_produto</option>";
NOTE: If I change from "product_product" to "model_product" it appears with the values correctly: