CSV2MySQL convert from CSV file into MySQL database

Bagaimana cara convert dari CSV ke dalam database MySQL menggunakan PHP.
Silahkan lihat langkah2 dibawah ini:

How to convert from CSV file into MySQL database using PHP?
Plus how to create a table and fields into database with PHP?
Here it is..
We need 3 files php, and 2 file jpg (the jpg is just for menu).

index.php

upload_csv.php

create_table.php

Image files:

Download file lengkap:

  CSV2MySQL.V.1.0.rar (6.4 KiB, 2,786 hits, Updated: 14 April 2011)

semoga membantu :mrgreen:

Share

You may also like...

14 Responses

  1. adrian says:

    eror mas upload csv-nya..ni errornya

    “Warning: mysql_num_fields(): supplied argument is not a valid MySQL result resource in C:\wamp\www\tes\upload_csv.php on line 20 Warning: copy(tmp/dsx464.csv): failed to open stream: No such file or directory in C:\wamp\www\tes\upload_csv.php on line 30 Warning: fopen(tmp/dsx464.csv): failed to open stream: No such file or directory in C:\wamp\www\tes\upload_csv.php on line 31 Warning: fgetcsv() expects parameter 1 to be resource, boolean given in C:\wamp\www\tes\upload_csv.php on line 34 Warning: fgetcsv() expects parameter 1 to be resource, boolean given in C:\wamp\www\tes\upload_csv.php on line 34
    ERROR, DATA TIDAK BISA MASUK…”

  2. adrian says:

    mas mau tanya agi nih,,

    datanya ko g masuk yah???

    pas ddi display cuma ada id yang auto increment tanpa akhir

    mohon pencerahaannya

  3. sasa says:

    saya coba masukin csv ke mysql , didalam table ada 4 field , tapi kenapa field terakhir selalu gak bisa masuk yach ??

  4. Vegy says:

    mas saya sudah coba dan tabelnya mau ter insert, tapi isi tabelnya yang ter record tidak beraturan, gak beraturannya seperti gni :
    field di mysql jum 6 bgt juga di CSV file columnya ada 6.
    ketika di import colum ke 2 tabel mysql nya terisi semua isi row CSV atau row CSV nya menjadi satu pada row tabel MySQL, dan yang lainnya kosong. gmn itu.?
    apa ada kesalahan pada File CSV nya??

  5. Vegy says:

    file CSV nya bulum separate by comma, tapi kalau sata import pake bawaan phpmyadmin berhasil semua row terisi sesuai data csv nya.
    bagai mana saya bisa mengubah file csv nya menjadi separate by comma.?

  6. tin2 says:

    can you speak in english? i can not understand what are you saying… please help me. i need to convert excel into mysql in large amount of data in excel form.

  7. cruisine says:

    mas…data berhasil masuk ke database..tapi datanya kosong..trus data yang masuk 1000 biji…padahal data sebenernya cuma 2 biji…gmn tuh…need ur help soon..

  8. Jawaad says:

    @tin2, yes you can use it, just increase the php execute time.
    Sample:

    @cruisine, kok bisa seperti itu? coba dicek kembali file CSV nya dan format nya.

  9. dennisYo says:

    Terima Kasih gan, very helpfully
    setelah saya coba formatnya harus csv(ms-dos)

  10. sultan says:

    Makasih gan,hasilnya OK punya gan.

    posting tutorial yg CRUD dong gan, keep it up gan!

Leave a Reply to adrian Cancel reply

Your email address will not be published. Required fields are marked *