Inserting binary data into SQL Server with ZF1 & PHP 7
If you want to insert binary data into SQL Server in Zend Framework 1 then you probably used the trick of setting an array as the parameter's value with the info required by the sqlsrv driver as noted in Some notes on SQL Server blobs with sqlsrv. Essentially you do this; $data['filename'] = 'test.gif'; $data["file_contents"] = array( $binaryData, SQLSRV_PARAM_IN, SQLSRV_PHPTYPE_STREAM(SQLSRV_ENC_BINARY), SQLSRV_SQLTYPE_VARBINARY('max') ); $db->insert($data); Where $db is an instance of Zend_Db_Adapter_Sqlsrv. If you use SQL Server… continue reading.