export mysql result to excel

后端 未结 2 1402
清酒与你
清酒与你 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:43

    I think if you client are using Office 2007, you have better to look into the Open Document.

    there is an implementation in php there. Also the Excel 2007 viewer is free so.

    0 讨论(0)
  • 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;
    }
    
    0 讨论(0)
提交回复
热议问题