Phpexcelexported file format for zhidao.baidu.comquestion515423304.html? Oldq1 & nbsp; thank you ------ solution ------------------ www. cnblogs. comdahuzizydarchive2 phpexcel export file format solution
Http://zhidao.baidu.com/question/515423304.html? Oldq = 1 Thanks
------ Solution --------------------
Http://www.cnblogs.com/dahuzizyd/archive/2012/07/06/2579738.html
It is important to output each line cyclically in the code.
Use mergeCells to merge cells as needed.
------ Solution --------------------
Http://bbs.csdn.net/topics/390237081
Http://bbs.csdn.net/topics/390263234
You can refer to these two posts
At that time, I asked statistics based on different people.
I don't know if it meets your requirements.
$ Last = array (); when $ row ['name']! = $ Last ['name'] is output
I feel that you have changed the part of my total computing to the one you want to output.
------ Solution --------------------
Use mergeCells ("A1": "A2"). you can write the code by referring to it.
------ Solution --------------------
Reference:
Now I can get it out, but I don't know why there is always one fewer record when I insert it in an excel loop.
I can see that there is no first line of code. after you compare the code, the output is different only when it is the same, no output, so it is unclear how to deal with phpexcel when there is a few lines.
This is the method I posted on the 4th floor to directly output the Php page for reference only.
$ SQL = "select * from record where officecode = '$ officecode' and searchtime like' % $ riqi % 'order by name limit $ offset, $ Page_size ";
$ Result = mysql_query ($ SQL, $ link );
$ Last = array ();
While ($ row = mysql_fetch_array ($ result )){
If ($ last ){
$ Row ['xingshi'] = (strtotime ($ row ['arrivetime'])-strtotime ($ last ['gotime'])/60;
If ($ row ['name'] = $ last ['name']) {// still the same group
$ Distance + = $ row ['distance ']; // calculates the total distance.
$ Xingshi + = $ row ['xingshi ']; // calculates the travel time.
}
Else {
// When the group changes, the driving time is 0.
$ Row ['xingshi '] = 0;
?>
Total
// Reset the travel distance and time after completing the total
$ Distance = $ row ['distance '];
$ Xingshi = 0;
}
}
Else {
// The distance and time of the first entry of each name
$ Distance = $ row ['distance '];
$ Xingshi = 0;
}
$ Last = $ row;
?>