這段代碼有問題,有幫助嗎?$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 關注
- 117 瀏覽
添加回答
舉報
0/150
提交
取消