Ver Mensaje Individual
  #2 (permalink)  
Antiguo 16/04/2014, 08:16
Avatar de YYs86
YYs86
 
Fecha de Ingreso: abril-2012
Ubicación: Salamanca
Mensajes: 136
Antigüedad: 12 años
Puntos: 14
Respuesta: Leer datos BD dependiendo selección en un select

Recoge el NAME del SELECT que le envías por POST/GET al controlador y luego recorrelo generando un:

Código PHP:
Ver original
  1. $Select = $this->input->post('select[]');
  2. $Cont = 0;
  3.  
  4. foreach ($Select as $Item) {
  5.  
  6.  
  7. if ($Cont == 0) {
  8.  
  9. $this->db->like('category',$Item);
  10.  
  11. }else{
  12.  
  13. $this->db->or_like('category',$Item);
  14.  
  15. }
  16.  
  17. $Cont++;
  18.  
  19. }
__________________
Web developer:

http://xtremgaming.es
http://leaderleague.com