0
I’m having a problem at a input
of the kind Select (follows the excerpt below). I am using version 7.0 of PHP and as DBMS Postgresql. I tried to use the function pg_fetch_array
but it was unsuccessful, someone has an idea of what might be wrong?
<?php
$consulta = "SELECT * FROM atividades";
$query = $db->db->query("SELECT * FROM atividades");
?>
<select>
<?php
echo "<select name='descricao'>";
while($cont = $query->fetch_array()) {
echo "<option value='".$cont["id"]."'>".$cont["descricao"]."</option>";
}
echo "</select>";
?>
</select>
This is the return specified by var_dump($query);
Before executing
$query->fetch_array()
, dovar_dump($query)
and put here the result.– Woss
post the connection code
$query->fetch_array(PDO::FETCH_ASSOC)
of avar_dumb($cont);
– WillBB
remembering that you have to give
$query->execute();
– WillBB