Eloquent error in bulk entry insert - development

Eloquent error in bulk entry insert

I will try to explain a problem shortly. I was having problem inserting data into database, all were working except data were not sitting in right columns. And this is what I have observed. Problem was I mistyped column name in array ($data_gl_table) but this did not throw an error.

Here is structure of an array:

$data_gl_table = [
     [0] => [...],
     [1] => [...],
     [2] => [...],
     ...
]

When I do below, colmns get messed up and no error.

gl_table::insert($row);

Gives an error when column name misspelled.

> foreach($data_gl_table as $row) {
>          gl_table::insert($row);
>}

Problem is why first method do not throw the error ?



from Laravel Questions and Answers https://laravelquestions.com/laravel/eloquent-error-in-bulk-entry-insert/
via Lzo Media

Comments

Popular posts from this blog

HTTP 401 Unable to create record Twillio PHP sdk 5.16 - development

Using PHP and MySQL data to generate PDF letters like in MS Word mailmerge functionality - development

ng-include of inline SVG does not display gradient except in Chrome