Home
Forums
Members
Search
Help
New topics
Todays topics
Website
Welcome Guest, Not a member yet?
Register
Sign In
Login
Username:
Password:
Remember me
Lost Password?
CodeIgniter Forums
CodeIgniter 4
CodeIgniter 4 Support
$model->update([], ['column' => NULL]) set the whole table column to null
Share on Google
Share on Facebook
Share on Twitter
View a Printable Version
Subscribe to this thread
Add Poll to this thread
Send thread to a friend
Linear Mode
Threaded Mode
$model->update([], ['column' => NULL]) set the whole table column to null
eelisland
Junior Member
Posts:
21
Threads:
7
Joined:
Aug 2020
Reputation:
0
#1
12-06-2022, 02:28 PM
Hello,
PHP Code:
$model
=
model
(
'myModel'
);
$model
->
update
([], [
'column'
=>
NULL
]);
If the first argument is an empty array, the entire table is affected, is it the normal behavior ?
CI 4.2.6
Reply
kenjis
Administrator
Posts:
3,681
Threads:
97
Joined:
Oct 2014
Reputation:
228
#2
12-06-2022, 10:01 PM
See
https://forum.codeigniter.com/showthread.php?tid=84833
ci-phpunit-test
|
CodeIgniter Testing Guide
|
CodeIgniter 3 to 4 Upgrade Helper
Reply
iRedds
Senior Member
Posts:
662
Threads:
36
Joined:
Apr 2019
Reputation:
45
#3
12-07-2022, 10:47 PM
Don't pass an empty array.
Reply
eelisland
Junior Member
Posts:
21
Threads:
7
Joined:
Aug 2020
Reputation:
0
#4
12-08-2022, 01:45 AM
@
kenjis
@
iRedds
Thanks for your feedbacks.
Reply
--------------------
Private Messages
User Control Panel
Who's Online
Search
Forum Home
General
-- News & Discussion
-- Events
-- Lounge
-- Regional User Groups
Using CodeIgniter
-- Installation & Setup
-- Model-View-Controller
-- Libraries & Helpers
-- Best Practices
-- Choosing CodeIgniter
-- General Help
CodeIgniter 4
-- CodeIgniter 4 Roadmap
-- CodeIgniter 4 Development
-- CodeIgniter 4 Feature Requests
-- CodeIgniter 4 Support
-- CodeIgniter 4 Discussion
-- CodeIgniter 4 Addins
Development
-- CodeIgniter 3.x
-- CodeIgniter 2.x
-- Issues
-- NetBeans Plugin
External Resources
-- Spotlight
-- Learn More
-- Jobs
-- Addins
Archived Discussions
-- Archived Libraries & Helpers
-- Archived Development & Programming
Theme © iAndrew 2016 -
Forum software by © MyBB