Hello, is there a way to easily do this? I tried this way:
http://laravelsnippets.com/snippets/seed-database-from-csv-file
but it doesn't work, I have a "model" table with an image column containing links and I think the method produces a mess.
example:
Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.";http://images
.it
.somestuff
.com/media/catalog/product/cache/1' at line 1 (SQL: insert into
models` ... bla bla bla
Probably this method doesn't specify all the info sql wants to consider a line as a single data. So, any effective way of converting a csv into a table seeder?
Post the first few lines from the CSV file you are trying to import. And the full text of the error.
You can use this app https://github.com/PejmanNik/ExcelToLaravelSeeder/blob/master/Win32/Release/Excel2LaravelSeeder.exe
just select excel file then set column name and the seeder will be generated
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community