The result of executing the same sql,php program is different from the result of the database execution, solving

Source: Internet
Author: User
The result of the same sql,php program execution is different from the results of the database execution, solving
The code for the output SQL and result set is as follows
$sql = $sql 1. $sql _initbest;
Echo $sql;
INITROWS4 ($start _date, $end _date, $objActSheet);

$months =getintmonth ($start _date, $end _date1);
$count _1=3* $months +3;//have 3 columns per month
echo $sql 1. $sql _initbest;
$query = Mssql_query ($sql);
$c = 0;
$arr =array (' A ', ' B ', ' C ', ' D ', ' E ', ' F ', ' G ', ' H ', ' I ', ' J ', ' K ', ' L ', ' M ', ' N ', ' O ', ' P ', ' Q ', ' R ', ' S ', ' T ', ' U ', ' V ', ' W ', ' X ', ' Y ', ' Z ');
$count _4=0;//Month counter
$n = 4;
$arr 1=array ();
while ($row =mssql_fetch_array ($query)) {
Print_r ($row);
echo "

";

Output note the data in the red box

Copy SQL to the database and execute the results as follows

I'm sure it's the same SQL, why is that?
------Solution--------------------
Do not format the data with the Number_format function
Instead, you should use a cell format to control it, such as
$sheet->getstyle (' D6 ')
->getnumberformat ()
->setformatcode (' #,# #0 ');
  • 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.