Código PHP:
function cargarCombo(){
try{
$query="select * from categorias";
//Preparamos la Consulta para su ejecucion:
$stmt =$this->con->prepare($query);
//Ejecutamos la Consulta
$stmt->execute();
//Obtengo el total de filas afectadas por la accion que se realiza
//$res=$stmt->rowCount();
//$data = $stmt->fetchAll();
$data = $stmt->fetchAll(PDO::FETCH_ASSOC);
}catch(PDOException $e){
echo $e->getMessage();
}//catch
}//Cargar Combobox
Código PHP:
//instancio la llamada a mi funcion
$data=$aviso->cargarCombo();
Código PHP:
<select name="categorias" class="form-control" >
<?php foreach ($data as $row){
echo '<option value="'.$row['id_categoria'].'">'.$row['categoria'].'</option>';
} ?>
</select>
Saludos y gracias a todos por su tiempo y su ayuda