Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Switch Database
Post: RE: Switch Database

I think one of them could suite you when loading a model (from docs): Use this in Controller. PHP Code:$db_config_file = $this->config->load('database');$config = ...
cyberstunts CodeIgniter 3.x 3 1,462 04-14-2020, 05:41 AM
  Thumbs Up Thread: insert, get ID of insert [FIXED: My fault]
Post: RE: insert, get ID of insert [FIXED: My fault]

Thank you, it seems to work both ways. By $db I meant the database connection e.g. PHP Code:$db = \Config\Database::connect();// insert row$record_id =...
cyberstunts Model-View-Controller 3 1,480 04-14-2020, 04:51 AM
    Thread: Using Entity with model, return empty Object
Post: RE: Using Entity with model, return empty Object

If no records are found, you will get null. Replace where statement with ID to test, e.g. PHP Code:$user = $userModel->where('user_id', 1)->first();  Otherwise noth...
cyberstunts CodeIgniter 4 Support 1 803 04-13-2020, 08:50 PM
    Thread: Switch Database
Post: RE: Switch Database

Documentation on Working With Databases provides with 2 straight forward ways: Define groups in configuration Load custom connection during page execution In more detail: Option 1: Add connect...
cyberstunts CodeIgniter 3.x 3 1,462 04-13-2020, 05:04 PM
    Thread: insert, get ID of insert [FIXED: My fault]
Post: RE: insert, get ID of insert [FIXED: My fault]

Documentation "Query Helper Methods" specifies that the correct usage is: PHP Code:$db->insertID();  and not PHP Code:$MyModel->insertID();  Can you share the code which work...
cyberstunts Model-View-Controller 3 1,480 04-13-2020, 04:06 PM
    Thread: PHPStorm yellow "Method not found in" notices
Post: RE: PHPStorm yellow "Method not found in" notices

I don't have the solution but can suggest clicking on the small "man in the hat" icon at the bottom right. There you can configure code inspection. I do have plugin installed "CodeIgniter" by Martyna...
cyberstunts CodeIgniter 4 Support 3 952 04-13-2020, 03:54 PM
    Thread: Debug is breaking my JSON... How to disable it from some methods ?
Post: RE: Debug is breaking my JSON... How to disable it...

For others looking for solution, just define MIME/"Content-Type" for proper response with all content types if similar functions to "setJSON" doesn't exist. CodeIgniter automatically disables debug b...
cyberstunts CodeIgniter 4 Support 8 5,775 04-13-2020, 03:39 PM

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.