title: How to save a random number to mysql in codeigniter
body: <p>Please can anybody help i want to generate randoms strings base on requested numbers and store them to a table in my mysql database using the MVC pattern of codeigniter. Thanks
  The controller</p>
  
  <pre><code>public function generate()
      {
  $this-&gt;news_model-&gt;generate_pin();
          $this-&gt;load-&gt;helper('string');
        echo random_string('alnum',15);
  </code></pre>
  
  <p>the model</p>
  
  <pre><code>public function generate_pin(){
  
        $this-&gt;load-&gt;helper('string');
     $this-&gt;db-&gt;insert('pin', $number); 
  </code></pre>
  
  
  
  <p>but nothing is happening also i want it to run 10 array at a time</p>