Welcome Guest, Not a member yet? Register   Sign In
Model's save method should scan for existing row
#1

save method was supposed to simplify logic to choose between insert/update, by scanning if row exist on the table or not. But as of right now, CodeIgniter 4.0.4, it only scans if table's primary key was mentioned on the input parameter.

So it will get confused when I want to insert a new data into a row with the primary key included. It will choose to update the data, because of the primary key which was included in the data, but fail to do so as the data itself is not there in the first place.

So I thought save method should look if inputted data was on the table to decide which method to use afterwards, insert or update.
Reply


Messages In This Thread
Model's save method should scan for existing row - by NaufalA - 08-23-2020, 05:27 PM



Theme © iAndrew 2016 - Forum software by © MyBB