PHP Export non-garbled and non-chaotic sequence of the problems of the great God, come in and help me.

Source: Internet
Author: User
PHP Export non-garbled non-random sequence of wonderful problems ask the big God to help my brother


The first diagram above is the export, the second is the actual data of the database, the careful buddies found that the exported figure three all changed to 0, this god horse situation AH

Ask the great God for guidance
The code is as follows:

Define (' Norobot ', 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= Prepaid card. xls");
$page = $page?: 1;
$results = Array ();
$condition = ";

echo "Prepaid phone number". " \ t ";
echo "Prepaid card serial number". " \ t ";
echo "Recharge amount". " \ t ";
echo "Real charge amount". " \ 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
is also thinking: the word is too small may not see clearly
  • Related Article

    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.