Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem w/ mysql_query...

Status
Not open for further replies.

admoore

IS-IT--Management
Joined
May 17, 2002
Messages
224
Location
US
I am trying to automate the importing of data comma-delimited data into a MySQL database. Somthing is wrong with my query and I can't quite get my finger on the problem. I suspect a syntax error but don't see it.

TIA for any help...

-A

Code:
$result = mysql_query("LOAD DATA LOCAL INFILE '/lc_import/fixed_list.txt'
                       INTO TABLE `lost_calls`
                       FIELDS TERMINATED BY ',' ENCLOSED BY '\"'
                       ESCAPED BY '\\' LINES TERMINATED BY '\r\n'
                       (`dealer_code`, `firstname`, `lastname`, `address`, `city`,
                        `state`, `zip`, `home`, `work`, `email`, `vin`, `year`, `make`,
                        `model`, `advisor_id`, `advisor_name`, `lost_date`)",$linkid);
 
Can't say I've ever tried LOAD DATA from a php page before now.
And as a mysql question, probably more pertinent for the mysql forum.
What errors does your page return ?

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
You can issue a LOAD DATA INFILE query from PHP. YOU cannot, however, issue a LOAD DATA LOCAL INFILE.

The "LOCAL" keyword tells MySQL that you will be transmitting the datafile through the connection from the client, not from a file on the filesystem. See


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top