Last active
August 29, 2015 13:58
-
-
Save maskaravivek/9999977 to your computer and use it in GitHub Desktop.
Excel Uploader usage
This file contains 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 characters
<?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