Re: SQL help
| From: | James | Date: | Mon, 12 May 2003 19:09:22 +0000 |
| Subject: | Re: SQL help | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-147337@lists.php.net to get a copy of this message | ||
LOAD DATA LOCAL INFILE 'F:/Program Files/MySQL-Front/import.csv' INTO TABLE
celebleague.leagues FIELDS TERMINATED BY ';' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n' (id,name,comment)
Your file syntax is not normal, you need to adjust it use the field
seperators etc.
"Brian V Bonini" <b-bonini@cox.net> wrote in message
news:1052758522.24967.19.camel@gfxdesign...
> Have this table
>
>
+------------+---------------------+------+-----+------------+--------------
--+
> | Field | Type | Null | Key | Default |
> Extra |
>
+------------+---------------------+------+-----+------------+--------------
--+
> | id | tinyint(3) unsigned | | PRI | NULL |
> auto_increment |
> | month | date | | | 0000-00-00
> | |
> | company | varchar(30) | | | 0
> | |
> | title | varchar(75) | YES | | 0
> | |
> | actor_name | varchar(20) | YES | | NULL
> | |
> | actor_role | varchar(75) | YES | | NULL
> | |
>
+------------+---------------------+------+-----+------------+--------------
--+
>
> using this query:
>
> LOAD DATA LOCAL INFILE "data.txt" INTO TABLE table
> (month,company,title,actor_name,actor_role);
>
>
> data.txt looks like:
>
> 2002-02-01;Coastal;Prospecting;Zoe Whitaker;Corporate Representative
> 2002-02-01;Commercial;Barton Ford;Dave Hobbs;Car Salesman
> 2002-02-01;Commercial;Barton Ford;Jackie Jackson;Customer's Wife
> 2002-02-01;Metro Video;"Right Spirit Campaign (Binge Drinking PSA), -
> Richmond, VA";Amie Hill;Spokesperson
> 2002-02-01;Metro Video;"Right Spirit Campaign (Binge Drinking PSA), -
> Richmond, VA";Tom Downs;Jim (Sailor)/Principal
> 2002-02-01;Metro Video;Colonial Williamsburg;Molly Larkin;Mother/Wife
>
> etc...
>
> I end up with a bunch of rows like this and teh data does not get
> imported:
>
> 0000-00-00;;;;
>
> Tried via MySQL front, phpmyadmin and directly via mysql al with same
> results.
>
>