Greetings,
I am trying to throw together a quick app to provide read-only access to a few tables...some of which have over a million rows and amount of fields can be over 200. Finally getting rid of our AS/400.
I am using the DataTables theme which my users like the most. Tested it with a small database.
By default, it tries to load the entire dataset into memory...which will not work.
I found the option for server-side processing but because of my lack of knowledge, I don't know what I need to modify and where to make this work.
Here are the changes I made to the default install of CodeIgniter/GroceryCRUD:
application/database.php - Added connection info for MySQL and set save_queries to FALSE.
application/controllers/Main.php - Set the index to show various table pages and functions for each table. Each table section uses the following simple settings:
* Set the theme to datatables
* Set the table name
* Unset the add, delete and edit buttons
* render the output.
Example:
public function table1() { $crud = new grocery_CRUD(); $crud->set_table('table1'); $crud->set_subject('Table description'); $crud->set_theme('datatables'); $output = $crud->render(); $this->_example_output($output); }
Error message (memory_limit in PHP.ini was increased but that is not feasible with this amount of data):
Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 3203257904 bytes) in /var/www/html/testapp/system/database/drivers/mysqli/mysqli_driver.php on line 305 A PHP Error was encountered Severity: Error Message: Allowed memory size of 536870912 bytes exhausted (tried to allocate 3203257904 bytes) Filename: mysqli/mysqli_driver.php Line Number: 305 Backtrace:
Server information:
Ubuntu Server 16.04.2 LTS MariaDB 10.1.22 Apache 2.4.18 PHP 7.0.15 CodeIgniter 3.1.2 GroceryCRUD 1.5.8