If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > ::: Importing the CSV data through phpMyAdmin :::

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-21-04, 06:54
jduk jduk is offline
Registered User
 
Join Date: Jan 2004
Posts: 10
::: Importing the CSV data through phpMyAdmin :::

Hi there,

I have a 2000 lines of data in the CSV file and would like to import the CSV file through PhpMyAdmin. I did not find the option in PhpMyAdmin. Do you have any solution or alternative for this?

Thanks,

Jag
Reply With Quote
  #2 (permalink)  
Old 01-21-04, 16:27
Dylan Leblanc Dylan Leblanc is offline
Registered User
 
Join Date: May 2002
Location: Vancouver Canada
Posts: 26
Perhaps you should try looking again. Go to Home > database > table > Properties/Structure > and at the bottom of the page is Insert data from a textfile into table.

Or you could write your own little PHP script to to the job.
__________________
http://skyscraperpage.com/
Reply With Quote
  #3 (permalink)  
Old 01-22-04, 04:13
jduk jduk is offline
Registered User
 
Join Date: Jan 2004
Posts: 10
Thank you,

I know that, usually i will insert the data through the text file. But here I want to upload the CSV file. You have any idea???

Thanks,

Jag
Reply With Quote
  #4 (permalink)  
Old 01-22-04, 13:16
Dylan Leblanc Dylan Leblanc is offline
Registered User
 
Join Date: May 2002
Location: Vancouver Canada
Posts: 26
I have never done it, but since the CSV is a text file, shouldn't it work if you just configure the form properly?
__________________
http://skyscraperpage.com/
Reply With Quote
  #5 (permalink)  
Old 01-23-04, 04:14
jduk jduk is offline
Registered User
 
Join Date: Jan 2004
Posts: 10
Hi,

Is CSV is a text file????? i am wondering... CSV file is a form of excel sheet. I have tried but I could not..

Thanks,

Jag
Reply With Quote
  #6 (permalink)  
Old 01-23-04, 05:33
Dylan Leblanc Dylan Leblanc is offline
Registered User
 
Join Date: May 2002
Location: Vancouver Canada
Posts: 26
Yes. Rename the extension to .txt and then open it. It's just a bunch of text, usually separeted with commas and/or other special characters. phpMyAdimin can handel these things.
__________________
http://skyscraperpage.com/
Reply With Quote
  #7 (permalink)  
Old 01-23-04, 05:47
jduk jduk is offline
Registered User
 
Join Date: Jan 2004
Posts: 10
ok, thanks, let me try it and get back to you.

Cheers!
Reply With Quote
  #8 (permalink)  
Old 01-23-04, 05:57
jduk jduk is offline
Registered User
 
Join Date: Jan 2004
Posts: 10
No way... I have tried.. could not do it.


thanks,
Reply With Quote
  #9 (permalink)  
Old 01-23-04, 06:08
Dylan Leblanc Dylan Leblanc is offline
Registered User
 
Join Date: May 2002
Location: Vancouver Canada
Posts: 26
Post the first few lines of text from the CSV file. Enclose them in the PHP tag (vB Code)
__________________
http://skyscraperpage.com/
Reply With Quote
  #10 (permalink)  
Old 02-03-04, 05:46
jduk jduk is offline
Registered User
 
Join Date: Jan 2004
Posts: 10
Hi there,

Thanks a bunch Dylan Leblanc. I got it. Its working fine. Here is the info. if some one is trying to do it.

For a "insert from textfile into table" to be successful, the data in the columns of your textfile must match the datatype of the column it will populate in MySQL. When using the "Insert data from a textfile into table" beware of "column head" rows in your textfile being imported. It's pretty straightforward. Hit the "Insert data from a textfile into table" link and simply follow the prompts on the page. By default, the field separator character is a ";" and change this to "," (comma separated values). I've never had any luck with the "replace" checkbox and turning "replace" on has never had an effect for me, maybe this will work in future releases. If you want to replace a table's data with new data from a .csv file, first empty the table then "insert data from a textfile".

Cheers......
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 On
Pingbacks are On
Refbacks are On