uploadFile($uploadFile, ''); if($result['Status'] == 'OK') { $func = new Worksheet($excel_file,$sheet_name); $total_cols = $func->getMaxColumn(0,255); $total_rows = $func->getMaxRow(0,10000); $headings = array(); for($i = 0; $i <= $total_cols; $i++) { $cell = generateAlphabet($i) . '1'; $result = $func->getCell($cell); $headings[] = $result->Value; } $ser_head = serialize($headings); global $wpdb; $sql = " DELETE FROM " .$wpdb->prefix."apc_shortcodes WHERE `filename` = '$excel_file'; "; $wpdb->query($sql); $querystr = " INSERT INTO " .$wpdb->prefix."apc_shortcodes SET `filename` = '$excel_file', `head_row` = '$ser_head' "; $wpdb->query($querystr); } } else { echo "Wrong File was selected!"; }