Read all rows from excel (.xls) and then insert into database (PHP) -


can provides me step or whole code read data excel file (.xls) , insert records database?

thank in advance,

use phpexcel library. see documentation examples.

/** include path **/ set_include_path(get_include_path() . path_separator . '../../../classes/');

/** phpexcel_iofactory */ include 'phpexcel/iofactory.php'; $inputfilename = './sampledata/example1.xls'; echo 'loading file ',pathinfo($inputfilename,pathinfo_basename),' using iofactory identify format<br />'; $objphpexcel = phpexcel_iofactory::load($inputfilename);  $sheetdata = $objphpexcel->getactivesheet()->toarray(null,true,true,true); var_dump($sheetdata); 

Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -