MySQL export ID to Excel for scientific counting method, how to deal with
Source: Internet
Author: User
MySQL export ID to Excel for scientific notation, what to do?
I am through phpexcelclasses the following method to export MySQL data to Excel, but when the identity card, it becomes the scientific notation, what method can be imported in advance to import the ID number of the Excel field set to text, to display the identity card normally?
Set_include_path (Get_include_path (). ";" . '.. /common/phpexcelclasses/');
Include ' phpexcel.php ';
Or include ' phpexcel/writer/excel2007.php ';
Include ' phpexcel/writer/excel5.php '; For the output. xls
Create an Excel
$objPHPExcel = new Phpexcel ();
Save excel-2007 Format
$objWriter = new phpexcel_writer_excel2007 ($objPHPExcel);
$objWriter->setoffice2003compatibility (TRUE);
$objWriter = new Phpexcel_writer_excel5 ($objPHPExcel); /
$objPHPExcel->setactivesheetindex (0);
$objPHPExcel->getactivesheet ()->setcellvalue (' A1 ', ' student number ');
$objPHPExcel->getactivesheet ()->setcellvalue (' B1 ', ' Social Security Number ');
..............................
$objWriter->save ("Info.xls");
------Solution--------------------
Use String type
------Solution--------------------
The exported value is automatically converted to characters before the symbol table space is added
------Solution--------------------
Single quotation mark with one half corner before the exported value
------Solution--------------------
discuss
Now is the ID card can not add any symbols, the first floor of what mean, how to use
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.