How to implement the following two files into the same Excel sheet inside

Source: Internet
Author: User
How to implement the following two files into the same Excel without sheet inside

How to implement the following two files into the same Excel Mod.xls without Sheet,sheet1 and Sheet2 inside
First PHP

Header ("Content-type:application/vnd.ms-excel");
Header (' content-disposition:attachment; filename= ' Mod.xls ');

Include (' comm.php ');
mysql_select_db (' Test ');

$sql = "SELECT * from Module6";
$query = mysql_query ($sql);
echo "unit sixth (1-6) \t\n";
echo "\ n";
echo "user name \ t 1th \ t 2nd question," the 3rd question \ t 4th title \ t 5th title \ t 6th question \t\n ";
while ($row = Mysql_fetch_array ($query)) {
echo "\ n";
echo $row [' username ']. " \ t ". $row [' strategy1 ']." \ t ". $row [' Strategy2 ']." \ t ". $row [' Strategy3 ']." \ t ". $row [' Strategy4 ']." \ t ". $row [' tellwho ']." \ t ". $row [' Diag ']." \ t "." \ n ";
}

?>






Header ("Content-type:application/vnd.ms-excel");
Header (' content-disposition:attachment; filename= ' Modxls ');

Include (' comm.php ');
mysql_select_db (' Test ');

$sql = "SELECT * from Module5";
$query = mysql_query ($sql);
echo "Unit V (1-3) \t\n";
echo "\ n";
echo "user name \ t 1th title \ t 2nd question \ t 3rd question \ n";
while ($row = Mysql_fetch_array ($query)) {
echo "\ n";
echo $row [' username ']. " \ t ". $row [' select11 ']." \ t ". $row [' Mailfile ']." \ t ". $row [' idea ']." \ t "." \ n ";
}

?>
------Solution--------------------
Please use the Phpexcel class

Since you can't export a CSV file from multiple workbooks at the same time, how can you expect to import a CSV file into multiple workbooks?
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.