Welcome Guest, Not a member yet? Register   Sign In
Need suggestion on "Call to a member function save() on null"
#2

(This post was last modified: 01-13-2022, 08:54 AM by captain-sensible. Edit Reason: added text )

whats your database situation and which one are you using ?

member function is same as class method ; either no data to pass to database or something up with database and its set up . Don't forget the data you pass in for fields has to match field names in database.

A lateral thinking approach might be to populate database, just a manual population of a couple of entries, then see if you can retrieve data using a contoller and pass to view. if that works then try and save.

The less going on the easier to see the mistake . I started with an sqlite database in fact I stuck with it , since WordPress has proved that security of MySQL or Maria is not necessarily more secure than sqlite. IN fact I stuck with sqlite for web. Also you can simply use sqlitebrowser to view /populate data quickly - no phpMyAdmin


A general approach would be to start trimming out the bloat - all that validation and increase output of error . At line 35 in app/Config/Logger.php set it to :

Code:
public $threshold = 9;


hopefully it might be more specific
CMS CI4 A CMS system, runs out of the box written on top of CI4
Arch Book  CodeIgniter4 on Apache(pages 92-114) 
Reply


Messages In This Thread
RE: Need suggestion on "Call to a member function save() on null" - by captain-sensible - 01-13-2022, 08:53 AM



Theme © iAndrew 2016 - Forum software by © MyBB