We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
当数据库中 contents 表为空时,也即博客中无文章。
访问首页引发 functions.php 中 checkField 函数报错
array_key_exists(): Argument #2 ($array) must be of type array, null given
由于 contents 表中没有数据。
functions.php 中 checkField 函数的判断字段是否存在语句。
$db->fetchRow($db->select()->from('table.contents')) 返回了一个 null。
$db->fetchRow($db->select()->from('table.contents'))
null
array_key_exists() 函数的第二个参数接受 null 后报错。
array_key_exists()
重写字段是否存在的判断逻辑,已提交 PR。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
触发条件
当数据库中 contents 表为空时,也即博客中无文章。
访问首页引发 functions.php 中 checkField 函数报错
array_key_exists(): Argument #2 ($array) must be of type array, null given
错误原因
由于 contents 表中没有数据。
functions.php 中 checkField 函数的判断字段是否存在语句。
$db->fetchRow($db->select()->from('table.contents'))
返回了一个null
。array_key_exists()
函数的第二个参数接受 null 后报错。解决方法
重写字段是否存在的判断逻辑,已提交 PR。
The text was updated successfully, but these errors were encountered: