Importing data from text file into mysql through PHP page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sukhpreet_ahluwalia
Forum Newbie
Posts: 3
Joined: Sat Mar 22, 2008 5:09 am

Importing data from text file into mysql through PHP page

Post by sukhpreet_ahluwalia »

Hello.
I have text file which data is sepearated by quoma .

What i have to is take that data and stored in mysql table giving the browising facility to user browse such file and the data should be stored in table.
Please Help its very urgent
Thanx in advance
Rovas
Forum Contributor
Posts: 272
Joined: Mon Aug 21, 2006 7:09 am
Location: Romania

Re: Importing data from text file into mysql through PHP page

Post by Rovas »

It' s quite complicated for a beginner to do this. You have to know about working with files, string and array operation plus mysql.
First you read the file use fopen then fgetcsv to take the line in question in to a string Use explode on the string to turn into an array. After this you use the mysql function to connect to a database and execute the query. Good luck!
sukhpreet_ahluwalia
Forum Newbie
Posts: 3
Joined: Sat Mar 22, 2008 5:09 am

Re: Importing data from text file into mysql through PHP page

Post by sukhpreet_ahluwalia »

Please Help me to give the code ....... about this whole logic if possible
Post Reply