Server : Apache System : Linux profile 3.10.0-1160.88.1.el7.x86_64 #1 SMP Tue Mar 7 15:41:52 UTC 2023 x86_64 User : apache ( 48) PHP Version : 8.0.28 Disable Function : NONE Directory : /var/www/html/venkat/electiveaug22/ |
<?php
mysql_connect("localhost","project","w3bproject") or die(mysql_error());
mysql_selectdb("upload") or die(mysql_error());
$basket = addslashes($_POST['subject1']);
header('Content-Type: text/csv; charset=utf-8');
header('Content-Disposition: attachment; filename='.$basket.'.csv');
$output = fopen('php://output', 'w');
$quer2=mysql_query("select discipline,rollno,name,basket,fe from itelectivesubmit where fe = '$basket' order by rollno") or die("Invalid Accesssese1 !!!");
$n=0;
fputcsv($output, array('Discipline','RollNo','Name','Basket','Subject'));
while($row = mysql_fetch_assoc( $quer2 ))
{
fputcsv($output, $row);
}
$quer2=mysql_query("select discipline,rollno,name,basket,fe from ecelectivesubmit where fe = '$basket' order by rollno") or die("Invalid Access2 !!!");
while($row = mysql_fetch_assoc( $quer2 ))
{
fputcsv($output, $row);
}
$quer2=mysql_query("select discipline,rollno,name,basket,fe from melectivesubmit where fe = '$basket' order by rollno") or die("Invalid Access !!!");
while($row = mysql_fetch_assoc( $quer2 ))
{
fputcsv($output, $row);
}
?>