Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > MySQL
|
MySQL General discussion about the MySQL database.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the MySQL section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 13th, 2005, 02:17 PM
Registered User
 
Join Date: Feb 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problems with Load Data Infile

Hello all,

I'm having trouble using LOAD DATA INFILE. It is only loading the first record.

My source file (a win32 txt file) has the following format:

1,1,James Begley,
2,1,Rhett Biglands,
3,1,Nathan Bock,
...

The command i'm using is:

LOAD DATA INFILE 'players.txt' INTO TABLE players FIELDS TERMINATED BY ',' LINES TERMINATED BY '/r/n' (idplayer, idsourceteam, playername)

However the above only inserts the first field. Why is that?

Thank you,
Marden Lee
 
Old February 16th, 2005, 08:33 AM
Registered User
 
Join Date: Feb 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Forgot I had this post here.
The problem was solved. It is obvious that I shouldn't have had the last comma on each line.

Also, '/r/n' doesn't need to be established as line terminator on win32 based text files. '/n' will suffice, contrary to what the documentation says.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Load Data mmurad_99 C# 5 September 9th, 2008 06:47 AM
Page won't load data in IE rinventive PHP How-To 8 June 23rd, 2006 10:03 PM
trying to load db data into data grid itsajourney Beginning VB 6 2 June 7th, 2005 12:05 PM
Stylesheet load problems ravirao Apache Tomcat 1 August 3rd, 2004 12:58 AM
how to load data into a table? hosefo81 PHP Databases 3 November 3rd, 2003 02:31 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.