PHP Storing compressed data in mssql image field

This is a discussion on PHP Storing compressed data in mssql image field within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hello all, I am trying to store a large string representing a RTF document through PHP in a MS SQL ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-11-2003
Marcel
 
Posts: n/a
Default PHP Storing compressed data in mssql image field

Hello all,

I am trying to store a large string representing a RTF document through PHP
in a MS SQL Server database. To gain diskspace i want to compress that
string.

My code looks like this:

str_replace("'","''",addslashes(gzcompress($RTF1)) )

The insert succeeds but the problem occurs when i try to retrieve the data
form the database and when i try to transform it to the original string, i
then use:

$RTFdecompressed = gzuncompress(stripslashes(str_replace("''","'",$RT F)));

But this does not work ok....

Can someone have any suggestions please?

Marcel


Reply With Quote
  #2 (permalink)  
Old 12-11-2003
Jedi121
 
Posts: n/a
Default Re: PHP Storing compressed data in mssql image field

"Marcel" a écrit le 11/12/2003 :
> Hello all,
>
> I am trying to store a large string representing a RTF document through PHP

[...]

Please do not multipost !

The answer I made you on alt.php.sql :

You must use the functions the other order!
First uncompress then stripslashes, then replace :
$RTFdecompressed =
str_replace("''","'",stripslashes(gzuncompress($RT F)));

--
Have you read the manual ?
http://www.php.net/manual/en/

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 12:20 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0