![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
25/10/2010, 11:25
|
| | Fecha de Ingreso: agosto-2009 Ubicación: Lima
Mensajes: 226
Antigüedad: 15 años, 5 meses Puntos: 3 | |
Respuesta: hacer condicion en funcion amigos hice esto, pero no me corre
<?php
class Meta_poi_model extends Model {
function Meta_poi_model() {
parent::Model();
}
function getAll($cod_dependencia,$nu_ano) {
$data=array();
if ($cod_dependencia='18') {
$data=array();
$query=$this->db->query("SELECT META from META_POI
WHERE ANO_EJE=?
and META not in (select cod_meta from mod_meta where estado=0)",
array($nu_ano));
} else{
$data=array();
$query=$this->db->query("SELECT META from META_POI
WHERE CODIGO_DEPENDENCIA=? AND ANO_EJE=?
and META not in (select cod_meta from mod_meta where estado=0)",
array($cod_dependencia,$nu_ano));
}
if($query->num_rows>0) {
foreach($query->result() as $row) {
$data[]=$row;
}
}
return $data;
}
donde esta mi falla? |