为了账号安全,请及时绑定邮箱和手机立即绑定

CUTENEWS.RU - 严格的标准:只有变量应该通过引用传递

CUTENEWS.RU - 严格的标准:只有变量应该通过引用传递

PHP
ITMISS 2023-04-28 14:19:27
这段代码有问题,有帮助吗?$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);


查看完整回答
反对 回复 2023-04-28
  • 1 回答
  • 0 关注
  • 71 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信