Re: Importing Data with Field Names

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



revDAVE wrote:
> Newbie...
> 
> I have phpmyadmin...
> 
> I'm basically looking for a quick way to import records and avoid hand-
> typing many field names.... (I can set the field types later)
> 
> Is there a way to import into mySql with let's say a csv file - (or Tab
> delimited file) and have the first row be the field names. Then might you be
> able to import into a mysql database table (with / or without it's own
> preexisting field names) and have the import auto-setup the field names from
> the 1st row....?
> 
> BTW: let's assume the file has many fields and a small amount of records....
> (no timeout issues)
> 
> I could use some help getting started with this....
> 
> 
> 
> --
> Thanks - RevDave
> Cool @ hosting4days . com
> [db-lists 09]
> 
> 
> 

Either LOAD DATA INFILE or mysqlimport had an option for using first row
as field names I think. The table may have needed to be created first
though.

If so, you could read the first line of the file and create the table
with some default like varchar(255) for each field depending on your
data, import it and then later change the field types.

-- 
Thanks!
-Shawn
http://www.spidean.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux