Welcome Guest, Not a member yet? Register   Sign In
CI drop_down() and static options
#3

[eluser]Asinox[/eluser]
i fill the dropdown with result from data base
Code:
echo form_dropdown('negocio',$negocios);

but now i know how put static option in the select and option from database together, in my Model

Code:
function listarTiposNegociosCombox(){ //COMBOX
        
        $query = $this->db->get('tipos_de_negocios');
        if($query->num_rows()>0){
            foreach($query->result_array() as $row){
                $data[$row['id']] = $row['tipo'];
                //return $row;
            }
            return $data;
        }else{
            return FALSE;
        }
        $query->free_result();
    }


this function make a select very fine, but ... now im asking, how ill put an extra <option value="">Select One</option> in the select when the select is filled from the database.


mmmm

Thanks


Messages In This Thread
CI drop_down() and static options - by El Forum - 02-27-2009, 07:15 PM
CI drop_down() and static options - by El Forum - 02-27-2009, 07:27 PM
CI drop_down() and static options - by El Forum - 02-27-2009, 10:34 PM
CI drop_down() and static options - by El Forum - 02-28-2009, 05:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB