I'm having trouble rightly mounting a <select>
within PHP, with data returned by mysqli
.
I tried this way:
<?php
$con = new mysqli("localhost", "root", "senha","bancodedados" ) or die (mysql_error());
$query = $con->query("SELECT * FROM pv_tipo_info_questionario");
while($reg = $query->fetch_array()) {
echo "<select><option name=\"ativo\" value=";
echo $reg["cod_tipo_info"];
echo "\"\>";
echo "<select><option name=\"ativo\" value=";
echo $reg["tipo_info_questionario"];
echo "\"\>";
}
?>