title: Picture resize function when uploading in CodeIgniter not working
body: <p>I made a function on the CodeIgniter framework so users can upload pictures of products to a product page. The thing is I want pictures to be resized to the width and height I want it to be. Since I added the image lib resize function in my upload function nothing is working anymore.</p>
  
  <p>This is my upload function:</p>
  
  <pre><code>public function upload() {
  
      $this-&gt;load-&gt;library('upload');
  
      if ( ! $this-&gt;upload-&gt;do_upload('userfile')) {
          $error = array('error' =&gt; $this-&gt;upload-&gt;display_errors());
          $this-&gt;load-&gt;view('product_form', $error);
      } else {
          $file_data = $this-&gt;upload-&gt;data();
          $this-&gt;load-&gt;library('image_lib');
          foreach ($results as $row) {
              $config['image_library'] = 'gd2';
              $config['source_image'] = './upload/' . $file_data["file_name"];
              $config['create_thumb'] = TRUE;
              $config['maintain_ratio'] = TRUE;
              $config['width'] = 75;
              $config['height'] = 50;
  
              $this-&gt;image_lib-&gt;clear();
              $this-&gt;image_lib-&gt;initialize($config);
              $this-&gt;image_lib-&gt;resize();
          }
  
          $this-&gt;db-&gt;insert('products', array(
              'product_foto'         =&gt; $file_data['file_name'],
              'product_naam'         =&gt; $this-&gt;input-&gt;post('product_naam'),
              'product_beschrijving' =&gt; $this-&gt;input-&gt;post('product_beschrijving'),
              'product_categorie'    =&gt; $this-&gt;input-&gt;post('product_categorie'),
              'ophaal_plaats'        =&gt; $this-&gt;input-&gt;post('ophaal_plaats'),
              'date_created'         =&gt; date('Y-m-d'),
              'date_updated'         =&gt; date('Y-m-d')
          ));
          $data['img'] = base_url() . '/upload/' . $file_data['file_name'];
          header('location:https://kadokado-ferran10.c9users.io/Product/');
      }
  </code></pre>
  
  <p>What am I doing wrong?</p>