Archive for the tag 'intermediate'

Sep 19 2008

How can add our excel files to mysql

Published by Root under Mysql, Php, excel, programlama

The scenario;
I have an excel list about our costumers info. So i want to add all excel data in to mysql.
First i must save excel (.csv) format. And open my php script. my php script;
[PHP]
$firstTakeAllData=file_get_contents($filenameofcvs);
$secondAddArray=explode(”n”,$firstTakeAllData);
foreach ($secondAddArray as $key=>$takeMyDataFor)
{
$mysqlData=explode(”;“,$takeMyDataFor);
mysql_query(’INSERT into mycostumer (name,surname,street,tel,email) values (”$mysqlData[0]“,”$mysqlData[1]“,”$mysqlData[2]“,”$mysqlData[3]“,”$mysqlData[4]“)’); // It’s good for one user but this a lot of query [...]

No responses yet