title: Form Validation in CodeIgniter?
body: <p>I am using form validation of CodeIgniter, it works fine but when, form validation fails, it does not display the validation errors, by using 
  <code>&lt;?php echo validation_errors();?&gt;</code>
  I am using </p>
  
  <pre><code>function insertProduct(){
      $this-&gt;load-&gt;library('form_validation');
      $this-&gt;form_validation-&gt;set_rules('pname','ProductName','trimirequired');
      if($this-&gt;form_validation-&gt;run()){
          $this-&gt;addProduct();
      }
      else{
          $this-&gt;load-&gt;model('inventory/stock');
      }
  </code></pre>