title: How to Build CRUD Slider in codeigniter?
body: <p>hallo i want to make slider but image can change new image, add new image or can delete old image. </p>
  
  <p>i alredy make admin to manage slider(add,edit,delete) but when i want to show slider in view, its not working.</p>
  
  <p>this is view code</p>
  
  <pre><code>&lt;section id="main-slider" class="no-margin"&gt;
      &lt;div class="carousel slide wet-asphalt"&gt;
          &lt;ol class="carousel-indicators"&gt;
              &lt;li data-target="#main-slider" data-slide-to="0" class="active"&gt;&lt;/li&gt;
              &lt;li data-target="#main-slider" data-slide-to="1"&gt;&lt;/li&gt;
              &lt;li data-target="#main-slider" data-slide-to="2"&gt;&lt;/li&gt;
          &lt;/ol&gt;
          &lt;div class="carousel-inner"&gt;
              &lt;?php if (count($galery)): foreach ($galery as $dt): ?&gt;  
              &lt;div class="item " style="background-image: &lt;?php echo base_url('images/'.$dt-&gt;image); ?&gt;"&gt;
                  &lt;div class="container"&gt;
                      &lt;div class="row"&gt;
                          &lt;div class="col-sm-12"&gt;
                              &lt;div class="carousel-content centered"&gt;
                                  &lt;h2 class="animation animated-item-1"&gt;&lt;?php echo $dt-&gt;nama; ?&gt;&lt;/h2&gt;
                                  &lt;p class="animation animated-item-2"&gt;&lt;?php echo $dt-&gt;content; ?&gt;&lt;/p&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;&lt;!--/.item--&gt;
              &lt;?php endforeach; endif; ?&gt;
  
          &lt;/div&gt;&lt;!--/.carousel-inner--&gt;
      &lt;/div&gt;&lt;!--/.carousel--&gt;
      &lt;a class="prev hidden-xs" href="#main-slider" data-slide="prev"&gt;
          &lt;i class="icon-angle-left"&gt;&lt;/i&gt;
      &lt;/a&gt;
      &lt;a class="next hidden-xs" href="#main-slider" data-slide="next"&gt;
          &lt;i class="icon-angle-right"&gt;&lt;/i&gt;
      &lt;/a&gt;
  &lt;/section&gt;
  </code></pre>
  
  <p>and this is controller</p>
  
  <pre><code>public function index()
  {
      $this-&gt;data['galery']= $this-&gt;mgalery-&gt;get_galery();
  
      $this-&gt;data['contents'] = $this-&gt;load-&gt;view('user/galery', $this-&gt;data, true);
      $this-&gt;load-&gt;view('wrapper_user',$this-&gt;data);
  }
  </code></pre>
  
  <p>and this is model</p>
  
  <pre><code>function get_galery()
      {
          $this-&gt;db-&gt;order_by('id_image','desc');
          $data = $this-&gt;db-&gt;get($this-&gt;tbl_galery);
          return $data-&gt;result();
      }
  </code></pre>
  
  <p>please help me how to show slider image from database?</p>
  
  <p>thank you.</p>