%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
<?php
include("secure/db_config.php");
//header to give the order to the browser
date_default_timezone_set('Asia/Kolkata');
$datess = date("d-m-y h:i:s");
header('Content-Type: text/csv');
header('Content-Disposition: attachment;filename=exported-data-'.$datess.'.csv');
$sdate = $_REQUEST['form'];
$To = $_REQUEST['To'];
$select_table=mysqli_query($connection,'SELECT business_plan_name,student_name,school_name,student_email, student_mobile,12_pass_year,sub_specialisation, other_member, category_business, explain_product, pitch_your_business,c_date FROM tbl_nextstartup_business order by bid DESC') or die(mysqli_error());
//}
$rows = mysqli_num_rows($select_table);
$rows = array("business_plan_name","student_name","school_name","student_email","student_mobile","12_pass_year","sub_specialisation","other_member","category_business","explain_product","pitch_your_business","c_date");
if($rows)
{
getcsv(array_keys($rows));
}
while($rows)
{
getcsv($rows);
$rows = mysqli_fetch_assoc($select_table);
}
// get total number of fields present in the database
function getcsv($no_of_field_names)
{
//$separate = '';
// do the action for all field names as field name
foreach ($no_of_field_names as $field_name)
{
if(preg_match('/\\r|\\n|,|"/', $field_name))
{
$field_name = '' . str_replace('', $field_name) . '';
}
echo $separate . $field_name;
//sepearte with the comma
$separate = ',';
}
echo "\r\n";
}
?>