简体   繁体   English

简单更新查询不起作用-MySQL

[英]Simple Update Query Not working - MySQL

Here is my Update Query in Laravel 这是我在Laravel中的更新查询

$do = DB::table('pipo_orders')
            ->where('id', 1)
            ->update(array('clientcopyimage' => 1));

The Table name is pipo_orders while i execute the query no change is happening to that particular coloumn. 表名是pipo_orders而我执行查询时,该特定列没有任何变化。

Is there any basic mistake in the Query 查询中是否有任何基本错误

Here is the Documentation i followed. 这是我遵循的文档。

As you said the datatype for clientcopyimage is varchar , then you should quote your value like Girish said 正如您所说的那样, clientcopyimage的数据类型是varchar ,那么您应该像Girish所说的那样引用您的值

$do = DB::table('pipo_orders')
            ->where('id', 1)
            ->update(array('clientcopyimage' => "1"));

If field data type varchar or enum then need to quote input value. 如果字段数据类型为varcharenum则需要引用输入值。

->update(array('clientcopyimage' => "1"));

otherwise Library will behave input value as numeric . 否则,Library将把输入值视为numeric

Please check your where chain method 请检查您的地方链方法

should have equal sign '=', 应该有等号“ =”,

$do = DB::table('pipo_orders')
        ->where('id','=',1)
        ->update(array('clientcopyimage' => 1));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM