title: Why the DB cannot get the data sent by post method?
body: <p>I am learning PHP OOP and I have a problem. This is a really beginner code, I am practicing to my exam but I'm stuck so I would need some help.
  I use CodeIgniter, the database library is filled and autoloaded.</p>
  <p>I have a form: user has to fill the name, email and phone fields. A controller gets it, give it to the model which should insert the data to the database but I get an error message: &quot;Column 'trainedName' cannot be null&quot; so I guess it doesn't get the data in the first place.</p>
  <p>view (simplified):</p>
  <pre><code>&lt;form action=&quot;index.php/aboutme/calling&quot; method=&quot;POST&quot; enctype=&quot;text/plain&quot;&gt;
    &lt;input class=&quot;callback&quot; type=&quot;text&quot; name=&quot;nev&quot; placeholder=&quot;Neved:&quot; required&gt;
    &lt;input class=&quot;callback&quot; type=&quot;email&quot; name=&quot;email&quot; placeholder=&quot;E-mail címed:&quot;  required&gt;
    &lt;input class=&quot;callback&quot; type=&quot;tel&quot; name=&quot;telszam&quot; placeholder=&quot;Telefonszámod (36201234567):&quot;  required&gt;
    &lt;input type=&quot;submit&quot;&gt;
  &lt;/form&gt;
  </code></pre>
  <p>controller:</p>
  <pre><code>class Aboutme extends CI_Controller {
  public function calling() {
              $datas=array();
              
              $trained = new Callback();
              $trained-&gt;addTrained($datas);
  
              $this-&gt;load-&gt;view('aboutme');
      }
  </code></pre>
  <p>model:</p>
  <pre><code>class Callback extends CI_Model {
  
      function __construct() {
          parent::__construct();
      }
  
      public function addTrained(){
  
          $na = $this-&gt;input-&gt;post('nev');
          $em = $this-&gt;input-&gt;post('email');
          $ph = $this-&gt;input-&gt;post('telszam');
  
          $datas = array(
              'trainedName' =&gt; $na, 
              'email' =&gt; $em, 
              'phone' =&gt; $ph
          );   
  
          $this-&gt;db-&gt;insert('trained', $datas);
  }        
  </code></pre>
  <p>Thank you for your help!</p>