..Csv to MySql..

Nah akhirnya jadi juga semua program dah kelar, sebenernya sih dah kelar dari sebelum libur lebaran kmrn tapi krn blom sempet update blog, yo wes jadinya skrng deh di lengkapinnya. Yup kmrn dah bikin Mysql ke Csv. Nah sekarang cara ngebalikinnya.

Csv to Mysql Code :


upload_dir ="xls/";
$my_upload->extensions = array(".xls",".txt",".csv");
$my_upload->max_length_filename = 50;
$my_upload->rename_file = false;

if(isset($_POST['Submit']))
{
if(empty($_FILES['upload']['name'])) {
?> the_temp_file = $_FILES['upload']['tmp_name'];
$my_upload->the_file = $_FILES['upload']['name'];
$my_upload->http_error = $_FILES['upload']['error'];
$my_upload->replace = (isset($_POST['replace'])) ? $_POST['replace'] : "n";
$my_upload->do_filename_check = (isset($_POST['check'])) ? $_POST['check'] : "n";
$new_name = (isset($_POST['name'])) ? $_POST['name'] : "";
$my_upload->upload($new_name);
$data_j=$my_upload->file_copy;

echo $data_j;
open_connection();
if(empty($data_j)) { ?>

Source : irene87.blogsome.com/csv2mysql

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s