Php export non-gibberish non-disordered query related issues please be frustrated to help your younger brother

Source: Internet
Author: User
Php export non-garbled and non-disordered query. please try again. help me. The first figure above is exported, and the second figure is the actual data of the database, careful friends will find that the last three digits of the exported graph are all 0. in this case, please kindly advise the code as follows: & nbsp; & lt ;? Phpdefine (NOROBOT, & nbsp; true); define (CURSCRIPT, & nbsp; charge)


The first figure above shows the exported data, and the second figure shows the actual data in the database. when you are careful, you will find that all three of the exported images have changed to 0.

Please kindly advise
The code is as follows:

Define ('nobot ', true );
Define ('curscript', 'charge ');
Require_once './include/common. inc. php ';


Header ("Content-type: application/vnd. ms-excel; charset = utf-8 ");
Header ("Content-Disposition: attachment?filename=recharge card .xls ");
$ Page = $ page? : 1;
$ Results = array ();
$ Condition = '';

Echo "phone number charged". "\ t ";
Echo "rechargeable card serial number". "\ t ";
Echo "recharge amount". "\ t ";
Echo "actual charge quota". "\ t ";
Echo "recharge time". "\ t ";

$ Query = $ mysqli-> multi_query ('Call UP_User_GetCardInfo ("'. $ condition. '","'. $ page. '"," 900000 ")' or die ($ mysqli-> error );

$ Query = $ mysqli-> store_result ();
While ($ record = mysqli_fetch_array ($ query, MYSQLI_BOTH )){

$ Phone = $ record ['phone'];
$ Cardid = $ record ['cardid'];
$ Charge = $ record ['charge'];
$ Achieve = $ record ['achieve '];
$ Chgdate = $ record ['usedate'];


Echo "\ n ";
Echo $ phone. "\ t ";
Echo $ cardid. "\ t ";
Echo $ charge. "\ t ";
Echo $ achieve. "\ t ";
Echo $ chgdate. "\ t ";


}
If (is_object ($ query) $ query-> free_result ();
$ Mysqli-> next_result ();





?>

------ Solution --------------------
"'$ Cardid \ t ";
There is a single quotation mark
Yes, you may not be able to see the word clearly if it is too small.

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.