0
I’m not getting popular my select.
Follow my code below:
<select>
<option>Selecione</option>
<?php while($serv = mysql_fetch_array(getAllServicos())) { ?>
<option value="<?php echo $serv['Codigo'] ?>"><?php echo $serv['Descricao'] ?></option>
<?php } ?>
</select>
Function getAllServices():
function getAllServicos(){
$database = open_database();
$sql = "SELECT Codigo, Descricao FROM `tblservico` WHERE `Status` = true";
$result = $database->query($sql);
if ($result->num_rows > 0) {
$found = $result->fetch_all(MYSQLI_ASSOC);
}
close_database($database);
return ($found);
}
Error:
Warning: mysql_fetch_array() expects Parameter 1 to be Resource, array Given in
It worked, thank you very much.
– user31040