Page 1 of 1

how to enter new line automatically in new row in colum of d

Posted: Sun Oct 03, 2010 12:03 pm
by realone
infact i have lots of data in thousand line like for example

2 Kilo Of Kesselkramer
2020 Bmx
2wheels
30 Luxury Homes
30000 Years Of Art
3d World
4wd Custom Guide
4wd Custom Utes
4wd Extreme
50 Of The Worlds Best Apartments
50 Something


i want that i just copy this all data and every line insert in new row of colum and give automatically id to every line
like
ID DATA
1 2020 Bmx
2 2 Kilo Of Kesselkramer


like this automaticaly create new coum where find ENter (new Line) and then automatically create ID how can i do that

Re: how to enter new line automatically in new row in colum

Posted: Sun Oct 03, 2010 5:09 pm
by John Cartwright
explode() on PHP_EOL (constant for newline), then foreach() with mysql's INSERT statement (primary key - id - set to auto increment).