这段代码有问题,有帮助吗?$var = reset($sql -> select(array( 'table' => 'news', 'join' => array('table' => 'story', 'where' => 'id = post_id'), 'where' => array("id = $id", 'or', "url = $id"))));错误:Strict Standards: Only variables should be passed by reference in$query = reset( $sql->select(array( 'table' => 'news', 'where' => $where ))); Strict Standards: Only variables should be passed by reference in
1 回答
慕娘9325324
TA贡献1783条经验 获得超4个赞
看看这里。
reset()
function 正在等待一个变量引用,而不是你传递给它一个function result。
您可以提取函数的结果,然后将其传递给reset()
如下所示。
$select = $sql -> select(array(
'table' => 'news',
'join' => array('table' => 'story', 'where' => 'id = post_id'),
'where' => array("id = $id", 'or', "url = $id")
))
$var = reset($select);
然后是另一个:
$select1 = $sql->select(array(
'table' => 'news',
'where' => $where
));
$query = reset($select1);
- 1 回答
- 0 关注
- 99 浏览
添加回答
举报
0/150
提交
取消