Welcome Guest, Not a member yet? Register   Sign In
Model refusing to insert data
#5

(01-08-2021, 08:28 AM)demyr Wrote: What is the error you receive?
Plus, check the input - select names in your view and compare them with Modals file and also your database table/columns.
Also, have you ever tried print_r($data) to see your received data?

Alright a bit of an update on things since I've figured out why I was having issues with entity classes not working (was a filename problem I didnt read the docs closely enough)

Okay, so now I've got data coming in from a POST req, I have already verified that the incoming data structure matches what I'm expecting. I'm able to validate the data, populate my user entity, it uses the setter methods I wrote, all is well here. The snag I'm hitting now is when I go to insert the data to my database.

Using the save/insert method inherited from CodeIgniter\Model returns false, and I can't wrap my head around why. At this point in time, I'm passing the user entity object to that save/insert method, which should automatically convert my data to an array. I tried doing that part myself by calling toArray() on my entity, and have verified that that does not do anything unexpected either and my data remains intact. Still no luck with insert or save.

Nothing explicitly throws an error, if something is failing (which it is) then it's doing so silently.
Reply


Messages In This Thread
Model refusing to insert data - by cantinsertdata - 01-06-2021, 10:10 PM
RE: Model refusing to insert data - by demyr - 01-08-2021, 08:28 AM
RE: Model refusing to insert data - by cantinsertdata - 01-08-2021, 01:12 PM
RE: Model refusing to insert data - by wdeda - 01-09-2021, 08:00 AM



Theme © iAndrew 2016 - Forum software by © MyBB