Error “Too few arguments to function”

前端 未结 1 752
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-14 14:48

I got an error in the following code piece: Too few arguments to function showtbl::GetTabellen_ns(), 0 passed in abcde/folder/php.php on line 153 and exactly 2 expecte

1条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-14 15:23

    You call the function like this: $this->GetTabellen_ns()

    But function needs two arguments (offset and limit).

    If you want to set these argument as optional argument, you can give them a default value like this:

    protected function GetTabellen_ns($offset = 0, $limit = 0){
     .
     .
     .
    }
    

    0 讨论(0)
提交回复
热议问题