Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Codeigniter, Severity: error –> Exception: Too few arguments to function, admin dashboard shows HTTP error 500

I am faced with an error in log files
This

ERROR - 2022-05-13 02:47:21 --> Severity: error --> Exception: Too few arguments to function Transactions_model::get_pending_dash(), 0 passed in /Applications/MAMP/htdocs/application/controllers/admin/Dashboard.php on line 47 and exactly 1 expected /Applications/MAMP/htdocs/application/models/Transactions_model.php 2134

Here is exact code under controllers for dashboard.php on line 47:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

$transactions = $this->transactions_model->get_pending_dash();

Here is exact code under transactions_model.php models :

  // total transactions ////////////////////////////////////////////
  function total_dash_transactions()
  {
    $s= $this->db->select("COUNT(*) as num")->get("transactions");
    $r = $s->row();
    if(isset($r->num)) return $r->num;
    return 0;

    return $result[0]->Transactions;
  }
    
    function get_pending_dash($user) 
    {
        $where = "status = '1' AND type = '2'";
        return $this->db->where($where)->order_by('id', 'DESC')->limit(20)->get("transactions");
    }

>Solution :

Because in your function get_pending_dash requires $user as a parameter, but based on your code also you did not use it so if you did not use the parameter just delete the $user like the code below.

function get_pending_dash() 
{
    $where = "status = '1' AND type = '2'";
    return $this->db->where($where)->order_by('id', 'DESC')->limit(20)->get("transactions");
}
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading