PHP:报错 strpos() expects parameter 1 to be string, integer given

简介: PHP:报错 strpos() expects parameter 1 to be string, integer given

PHP报错:

strpos() expects parameter 1 to be string, integer given

出错代码

public static function showArticle($id)
    {
        ArticleModel::where('id', '=', $id)
            ->update(['is_show', 0]);
    }

问题在于数组的格式写错了

->update(['is_show', 0]);

应该修改为

public static function showArticle($id)
    {
        ArticleModel::where('id', '=', $id)
            ->update(['is_show'=> 0]);
    }
相关文章
|
DataWorks 数据管理 大数据
DataWorks操作报错合集之如何解决表字段类型从string改为datetime报错
DataWorks是阿里云提供的一站式大数据开发与治理平台,支持数据集成、数据开发、数据服务、数据质量管理、数据安全管理等全流程数据处理。在使用DataWorks过程中,可能会遇到各种操作报错。以下是一些常见的报错情况及其可能的原因和解决方法。
|
9月前
|
数据库
【YashanDB 知识库】exp 导出 csv 报错 YAS-00218 string conversion failed
**问题分类:** 数据导入导出 **关键字:** YAS-00218 string conversion failed **问题描述:** 使用 exp 导出成 CSV 时,报错 YAS-00218 string conversion failed。 **原因分析:** 数据库服务端字符集为 GBK,但客户端缺少 yasc_env.ini 文件,导致默认使用 UTF8 字符集。 **解决方法:** 创建 yasc_env.ini 文件并设置 CHARACTER_SET=GBK。 **影响范围:** 23.2.1.100
|
JSON Java 关系型数据库
Java更新数据库报错:Data truncation: Cannot create a JSON value from a string with CHARACTER SET 'binary'.
在Java中,使用mybatis-plus更新实体类对象到mysql,其中一个字段对应数据库中json数据类型,更新时报错:Data truncation: Cannot create a JSON value from a string with CHARACTER SET 'binary'.
1236 4
Java更新数据库报错:Data truncation: Cannot create a JSON value from a string with CHARACTER SET 'binary'.
|
应用服务中间件 Shell PHP
pbootcms模板报错提示PHP Warning: Unknown: open_basedir restriction
pbootcms模板报错提示PHP Warning: Unknown: open_basedir restriction
|
PHP
PHP——oneinstack重新安装PHP的时候报错
PHP——oneinstack重新安装PHP的时候报错
215 4
|
Java Android开发
解决Android编译报错:Unable to make field private final java.lang.String java.io.File.path accessible
解决Android编译报错:Unable to make field private final java.lang.String java.io.File.path accessible
3265 1
|
SQL 数据库 数据安全/隐私保护
【Python】已解决:(SqlServer报错)SQL错误(208):对象名‘string_split’无效
【Python】已解决:(SqlServer报错)SQL错误(208):对象名‘string_split’无效
548 2
|
PHP
PHP——安装ThinkPHP框架报错
PHP——安装ThinkPHP框架报错
171 0
|
PHP
php 使用phpize报错Cannot find config.m4. Make sure that you run ‘/usr/bin/phpize‘ in the top l
php 使用phpize报错Cannot find config.m4. Make sure that you run ‘/usr/bin/phpize‘ in the top l
709 1
|
Ubuntu PHP
ubuntu php libzip安装 ./configure报错 checking for libzip... not found configure
ubuntu php libzip安装 ./configure报错 checking for libzip... not found configure
329 1
下一篇
oss云网关配置