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]);
    }
相关文章
|
6月前
|
DataWorks 数据管理 大数据
DataWorks操作报错合集之如何解决表字段类型从string改为datetime报错
DataWorks是阿里云提供的一站式大数据开发与治理平台,支持数据集成、数据开发、数据服务、数据质量管理、数据安全管理等全流程数据处理。在使用DataWorks过程中,可能会遇到各种操作报错。以下是一些常见的报错情况及其可能的原因和解决方法。
|
3月前
|
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'.
315 4
Java更新数据库报错:Data truncation: Cannot create a JSON value from a string with CHARACTER SET 'binary'.
|
4月前
|
应用服务中间件 Shell PHP
pbootcms模板报错提示PHP Warning: Unknown: open_basedir restriction
pbootcms模板报错提示PHP Warning: Unknown: open_basedir restriction
|
6月前
|
PHP
PHP——oneinstack重新安装PHP的时候报错
PHP——oneinstack重新安装PHP的时候报错
90 4
|
6月前
|
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
874 1
|
6月前
|
PHP
PHP——安装ThinkPHP框架报错
PHP——安装ThinkPHP框架报错
67 0
|
7月前
|
SQL 数据库 数据安全/隐私保护
【Python】已解决:(SqlServer报错)SQL错误(208):对象名‘string_split’无效
【Python】已解决:(SqlServer报错)SQL错误(208):对象名‘string_split’无效
258 2
|
8月前
|
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
338 1
|
8月前
|
Ubuntu PHP
ubuntu php libzip安装 ./configure报错 checking for libzip... not found configure
ubuntu php libzip安装 ./configure报错 checking for libzip... not found configure
137 1
|
8月前
|
PHP 数据库
phpMyAdmin报错 in ./libraries/config/FormDisplay.php#661 continue targeting switch is equivalent to
phpMyAdmin报错 in ./libraries/config/FormDisplay.php#661 continue targeting switch is equivalent to
56 0