export mysql result to excel

喜欢而已 提交于 2019-11-30 10:58:16

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;
}

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!