当前位置: 动力学知识库 > 问答 > 编程问答 >

cakephp returns error on empty array?

问题描述:

I am doing a simple find to select a opponent for a game:

return $this->find('first'....

As long as I find a player, the function returns the array of results...

But as soon as I get no results, the array is empty, I get the following error message:

Warning (2): strlen() expects parameter 1 to be string, array given [CORE\Cake\Network\CakeResponse.php, line 496]

Notice (8): Array to string conversion [CORE\Cake\Network\CakeResponse.php, line 525]

Array

I can't really understand why I get this error and where it is based.

Any ideas?

分享给朋友:
您可能感兴趣的文章:
随机阅读: