title: uncaught ArgumentCountError: Too few arguments to function in codeigniter
body: <p>I want to pass data from model to controller in codeigniter and get this error :</p>
  
  <blockquote>
    <p>An uncaught Exception was encountered Type: ArgumentCountError
    Message: Too few arguments to function Debitur::get_data_sms(), 0
    passed in
    C:\xampp\htdocs\sms_gateway_2\application\controllers\User.php on line
    119 and exactly 3 expected</p>
    
    <p>Filename: C:\xampp\htdocs\sms_gateway_2\application\models\Debitur.php</p>
    
    <p>Line Number: 9</p>
    
    <p>Backtrace:</p>
    
    <p>File: C:\xampp\htdocs\sms_gateway_2\application\controllers\User.php
    Line: 119 Function: get_data_sms</p>
    
    <p>File: C:\xampp\htdocs\sms_gateway_2\index.php Line: 315 Function:
    require_once</p>
  </blockquote>
  
  <p>This is my function in model (Debitur.php) :</p>
  
  <pre><code>    public function get_data_sms($nama_deb, $no_hp, $tunggakan)
        {  
  
      $array = array('nama_deb' =&gt; $nama_deb, 'no_hp' =&gt; $no_hp, 'tunggakan' =&gt; $tunggakan);
      $query = $this-&gt;db-&gt;getwhere('sms_debitur', $array);
  
      return $query-&gt;result();
        }
  </code></pre>
  
  <p>This is my function in controller (User.php) :</p>
  
  <pre><code>    public function sending_sms(){
  
      $this-&gt;load-&gt;library('bulkSms');
  
      $data= $this-&gt;debitur-&gt;get_data_sms();
  
      if ($data){
              $bulkSms = new bulkSms('***');
  
              $device = 111;
              $options = [];
  
              $number = $no_hp;
              $message = "To ".$nama_deb." payment ".$tunggakan."..";
  
              $result = $bulkSms-&gt;sendMessageToNumber($number, $message, $device, $options);
  
              if (count($result['response']['result']['success']) &gt; 0) {
              $this-&gt;session-&gt;set_flashdata('message', '&lt;div class="alert alert-success"&gt;Berhasil mengirim sms&lt;/div&gt;');
              } else {
              $this-&gt;session-&gt;set_flashdata('message', '&lt;div class="alert alert-danger"&gt;Gagal mengirim sms&lt;/div&gt;');
              }
  
              redirect('user/send_sms', 'refresh');
  
      }
  }
  </code></pre>