开发者社区 问答 正文

laravel 报错 htmlentities() expects parame?报错

我从数据库拿出一条数据

$result = DB::select("SELECT SUM(right_wrong) AS sum FROM `hw_student_answers` where hw_paper_id=$paper_id GROUP BY `hw_paper_id`");

然后测试打印结果没有错

我想把结果输出到页面上所以

<td>{{$result}}</td>

结果报错htmlentities() expects parameter 1 to be string, array given,请大神帮我看一下是怎么回事


展开
收起
爱吃鱼的程序员 2020-06-09 13:59:15 438 分享 版权
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    自己回答,因为没foreach循环,而且也没指向sum

    2020-06-09 13:59:31
    赞同 展开评论
问答分类:
问答地址: