export mysql result to excel

后端 未结 2 1434
清酒与你
清酒与你 2021-01-01 07:59

I found a little script that will export information to an xls file, but I can\'t seem to get it working. The original code is found here: http://www.appservnetwork.com/modu

2条回答
  •  春和景丽
    2021-01-01 08:48

    If the actual information is strings, this won't work. Pack("d" is trying to cast it as a Double instead of a String.

    You need to create a xlsWriteString function.

    Looks like there's one here: http://hunter.forumotion.com/forum-f9/topic-t98.htm

    function xlsWriteString( $Row , $Col , $Value )
    {
    $L = strlen( $Value );
    echo pack( "ssssss" , 0x204 , 8 + $L , $Row , $Col , 0x0 , $L );
    echo $Value;
    return;
    }
    

提交回复
热议问题