Skip to content

Instantly share code, notes, and snippets.

@maskaravivek
Last active August 29, 2015 13:58
Show Gist options
  • Save maskaravivek/9999977 to your computer and use it in GitHub Desktop.
Save maskaravivek/9999977 to your computer and use it in GitHub Desktop.
Excel Uploader usage
<?php
include 'simplexlsx.class.php';
include 'config.php';
$xlsx = new SimpleXLSX('ringtones.xlsx');
$excel = array(array());
$excel = $xlsx->rows();
for($i=1;$i<sizeof($excel);$i++){
$name = $excel[$i][0];
$artist = $excel[$i][1];
$album = $excel[$i][2];
$link=$excel[$i][3];
$full_link=$excel[$i][4];
$cat=$excel[$i][5];
$popularity=$excel[$i][6];
mysql_query("INSERT INTO `ringtones` (`name`,`singer`,`album`,`full_file_link`,`link`,`category`,`popularity`) VALUES ('$name','$artist','$album','$full_link','$link','$cat','$popularity') ");
}
echo $i." rows inserted";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment