使用MSSQL将PHP中的Blob写入SQL服务器
我有一组AMFPHP服务,它们从Flex应用程序接收包含图像的bytearray。到现在为止,一直都还不错。现在,我需要将bytearray写入SQL Server数据库中的blob字段。我正在使用MSSQL库,我无法更改它。我如何才能做到这一点?在解决方案下面:使用MSSQL将PHP中的Blob写入SQL服务器,php,sql-server,apache-flex,blob,Php,Sql Server,Apache Flex,Blob,我有一组AMFPHP服务,它们从Flex应用程序接收包含图像的bytearray。到现在为止,一直都还不错。现在,我需要将bytearray写入SQL Server数据库中的blob字段。我正在使用MSSQL库,我无法更改它。我如何才能做到这一点?在解决方案下面: // Stores bytearray received from a Flex app through AMPPHP $arrData = unpack("H*hex", $image->data); $content =
// Stores bytearray received from a Flex app through AMPPHP
$arrData = unpack("H*hex", $image->data);
$content = "0x".$arrData['hex'];
$sql = "insert into Images (Id, ImageData) values ($id, $content)";
mssql_query($sql);
现在PHP中字节数组的代码是什么?