Results 1 to 10 of 10
  1. #1
    Join Date
    Jan 2004
    Posts
    10

    Unanswered: ::: 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

  2. #2
    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.

  3. #3
    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

  4. #4
    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?

  5. #5
    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

  6. #6
    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.

  7. #7
    Join Date
    Jan 2004
    Posts
    10
    ok, thanks, let me try it and get back to you.

    Cheers!

  8. #8
    Join Date
    Jan 2004
    Posts
    10
    No way... I have tried.. could not do it.


    thanks,

  9. #9
    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)

  10. #10
    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......

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •