Reputation: 1862
Here is my Update Query in 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.
Is there any basic mistake in the Query
Here is the Documentation i followed.
Upvotes: 0
Views: 131
Reputation: 448
Please check your where chain method
should have equal sign '=',
$do = DB::table('pipo_orders')
->where('id','=',1)
->update(array('clientcopyimage' => 1));
Upvotes: 0
Reputation: 12127
If field data type varchar
or enum
then need to quote input value.
->update(array('clientcopyimage' => "1"));
otherwise Library will behave input value as numeric
.
Upvotes: 0
Reputation: 11320
As you said the datatype for clientcopyimage
is varchar
, then you should quote your value like Girish said
$do = DB::table('pipo_orders')
->where('id', 1)
->update(array('clientcopyimage' => "1"));
Upvotes: 1