下面由thinkphp教程欄目給大家介紹解決tp5遇到Call to a member function toArray() on array的報(bào)錯(cuò)的方法,希望對(duì)需要的朋友有所幫助!
在寫代碼是又遇到Call to a member function toArray() on array的報(bào)錯(cuò),居然還是不會(huì)改,寫個(gè)博客記錄一下。
改正時(shí)是在applicationdatabase.php中 的
// 數(shù)據(jù)集返回類型 'resultset_type' => 'array',
改為
// 數(shù)據(jù)集返回類型 'resultset_type' => 'collection', 這樣就可以啦