I don't want t put the data inside one by one,how to put a great quantity data by one time? My data in Excel .want to change into database(my sql)
Asked
Active
Viewed 49 times
0
-
check this link http://stackoverflow.com/questions/1310166/how-to-import-an-excel-file-in-to-a-mysql-database i think it helpfull. – Ron May 27 '14 at 05:45
2 Answers
0
If you are referring to migrate from excel to mysql, there are plenty like https://www.webyog.com/product/downloads/ if its just about loading data you can use go through this http://dev.mysql.com/doc/refman/5.1/en/load-data.html

Devesh
- 2,024
- 2
- 16
- 21
0
convert your excel to csv and upload using following script
<?php
include 'connection.php';
if(isset($_POST['Submit']))
{
if ($_FILES['csv']['size'] > 0)
{
//get the csv file
$file = $_FILES['csv']['tmp_name'];
$handle = fopen($file,"r");
while ($data = fgetcsv($handle,1000,","))
{
mysql_query("INSERT INTO tablename (col1, col2,col3) VALUES
(
'".addslashes($data[0])."',
'".addslashes($data[1])."',
'".addslashes($data[2])."'
)
") or die(mysql_error());
header('Location: home.php');
}
}
}
?>
<form action="" method="post" enctype="multipart/form-data" name="form1" id="form1">
Choose your file:<input name="csv" type="file" id="csv" />
<input type="submit" name="Submit" value="Submit" />
</form>

Ezhil
- 996
- 8
- 13