Solved

mysql load data infile

Posted on 2009-05-12
2
1,012 Views
Last Modified: 2013-12-12
for windows

mysql load data infile 'c:/infile.txt'
is proper syntax

and not 'c:\'
why
0
Comment
Question by:shopjd
2 Comments
 
LVL 8

Accepted Solution

by:
Bobaran98 earned 250 total points
Comment Utility
Probably because when you're working with slashes in PHP, the backslash is a reserved character.  For example, if you use PHP to echo "\n" or "\t" into your HTML code, you'll get a new line or a tab respectively.  If you'd like to use the actualy backslash, double it.  Thus the following would be as acceptable as what with a single forward slash:

load data infile 'c:\\infile.txt'
Read more here:  http://dev.mysql.com/doc/refman/5.1/en/load-data.html

Just search for the word "slash" about a fifth of the way down!
0
 
LVL 21

Assisted Solution

by:theGhost_k8
theGhost_k8 earned 250 total points
Comment Utility
It can be
mysql load data infile 'c:/infile.txt'
or
mysql load data infile 'c:\\infile.txt'

extra \ required for escaping
0

Featured Post

Easy Project Management (No User Manual Required)

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now