Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 1st, 2005, 02:20 PM
nav nav is offline
Registered User
 
Join Date: Aug 2004
Location: halsowen, , United Kingdom.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Importing data from a text file

Hi,

I need some help trying to import data from a text file which is to be inserted into a mysql database.

I need to do this through php but i have no idea of how to do this.

Any help would be much great!

Reply With Quote
  #2 (permalink)  
Old March 4th, 2005, 07:30 AM
Authorized User
 
Join Date: Feb 2004
Location: Karachi, , Pakistan.
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to knight
Default

The LOAD DATA INFILE command is used to rapidly load data from external text files in MySQL. You should read http://www.mysql.com/documentation/m...html#LOAD_DATA

and
try

mysql> USE db1;
mysql> LOAD DATA INFILE 'data.txt' INTO TABLE db2.my_table;

Hope this helps. As long as your text data is formatted sensibly (eg: tab or comma delimited or something similar) it should be no problem.

----------------------------------------------------------------------



Reply With Quote
  #3 (permalink)  
Old March 7th, 2005, 02:42 PM
nav nav is offline
Registered User
 
Join Date: Aug 2004
Location: halsowen, , United Kingdom.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for that information.

I have successfully entered the data from the text file.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
importing text file into excel stealthdevil Excel VBA 2 July 10th, 2007 11:28 AM
Text file importing & data processing jarpola Excel VBA 0 January 16th, 2007 10:27 AM
Importing a text file DBN Beginning VB 6 6 April 24th, 2006 02:52 PM
Problem importing text file manuel Access 3 April 7th, 2004 09:36 AM
BCP error while importing data from a text file happygv SQL Server ASP 1 December 15th, 2003 09:16 AM



All times are GMT -4. The time now is 05:15 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.