doumu8911 2018-08-03 06:54
浏览 446
已采纳

致命错误:未捕获的ArgumentCountError

I get this error. I created a button to update the table. When I click the button, I get an error. How to fix it?

Fatal error: Uncaught ArgumentCountError: Too few arguments to function personel::update_form(), 0 passed in C:\xampp\htdocs\warehouse\panel\system\core\CodeIgniter.php on line 360 and exactly 1 expected in C:\xampp\htdocs\warehouse\panel\application\controllers\personel.php:57 Stack trace: #0 C:\xampp\htdocs\warehouse\panel\system\core\CodeIgniter.php(360): personel->update_form() #1 C:\xampp\htdocs\warehouse\panel\index.php(202): require_once('C:\xampp\htdocs...') #2 {main} thrown in C:\xampp\htdocs\warehouse\panel\application\controllers\personel.php on line 57

Fİle Name: personel.php Controller

MY CODES

 public function update_form($id){

        $where = array( "id" => $id);

        $personel = $this->Personel_model->get($where);

        $viewData["personel"] = $personel;


        $this->load->view("personel_edit");

     }

MY BUTTON CODES

 <a href="<?php echo base_url("personel/update_form"); ?>" class="btn-sm btn-warning">Update </a>
  • 写回答

1条回答 默认 最新

  • douyan2680 2018-08-03 07:02
    关注

    You must pass any ID with the button to function in the controller like this.

     <a href="<?php echo base_url("personel/update_form/".$row->id); ?>" class="btn-sm btn-warning">Update </a>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 阿拉蕾的可能性人看胜利项目
  • ¥20 cesm的气溶胶排放文件
  • ¥30 关于#wpf# devexpress的问题:选中时是黑色未选中是白色字体,想要更改未选中时字体的颜色(语言-c#)
  • ¥15 逐月累计,月份不连续,补齐月份
  • ¥15 应用简单的Python代码完成一个学生成绩管理系统
  • ¥15 用matlab求微分方程初值问题
  • ¥15 vscode下编写第三方库opencv与pcl代码时没有代码提示
  • ¥15 能够跑通不报错,如何解决?(标签-matlab)
  • ¥15 MOS在RDS较大,频率高时开关波形异常
  • ¥15 SCENIC分析报错求解答