Last active
December 22, 2015 03:38
Revisions
-
umairidrees renamed this gist
Sep 2, 2013 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
umairidrees created this gist
Sep 2, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ <?php if(isset($_POST['submitcsv'])){ $file = $_FILES['file']['tmp_name']; $handle = fopen($file,"r"); while($file = fgetcsv($handle,1000, ",")){ $sql = mysql_query("INSERT INTO `table`(`value-1`, `value-2`) VALUES ('$file[0]','$file[1]')"); }; } ?> <form method="post" action="" enctype="multipart/form-data"> <input type="file" name="file" > <input type="submit" name="submitcsv" value="Import" > </form>