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 ');