I am writing my first program using Codeigniter and ran into a problem. I will start with a focused description of the problem and can expand it if I need:
I need to write a multidimensional array in the database and you want to use the insert_batch function from the CI_DB_active_record class to do this. The problem is that I need to write empty values ββas NULL for some fields, while other fields should be empty. The current function wraps all values ββin single quotes, and I cannot find a way to write null values ββto the database for the specified fields.
I would also like to increase the number of entries per package.
I see how to extend models, libraries, etc., but is there a way to extend the CI_DB_active_record class without changing the main classes? The minimum modification size of the main class to do this work, which I found, changes the following lines in the DB.php file (changing the require_once file to a new file that extends the CI_DB_active_record class and changes the CI_DB_active_record class name to the new class name):
require_once(BASEPATH.'database/DB_active_rec'.EXT); if ( ! class_exists('CI_DB')) { eval('class CI_DB extends CI_DB_active_record { }'); }
Can i do better?
source share