CodeIgniter Forums

Full Version: Database Seeder
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there a way to put multiple datasets into the $data variable described here?

I try to go with a multidimensional array but it tells me that there is a mysql error :$
The $data can only be one level because it is defining the columns in the database table.
you can do as follows to be able to insert multiple records

$data_category = [
array('category' => 'Test 01', 'ordination' => '1'),
array('category' => 'Test 02', 'ordination' => '2'),
array('category' => 'Test 03', 'ordination' => '3'),
array('category' => 'Test 04', 'ordination' => '4')

// Using Query Builder

Hope this helps