RE: storing bzcompressed data in MySQL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> I've got an automated system that will be storing text files of up to
> about 20k.  In peak times, I expect to have two to three million of
> these text files "on demand", though in reality they'll be expired
*way*
> more often than they're referenced.
> 
> To save space, I'd like to store the text using bzcompress(), but when
I
> use a construct like this:
> 
> $q = "INSERT INTO item (bztext) ('" . bzcompress($text,9) . "')";
> 
> But running the query gets my mysql_error() results of
> You have an error in your SQL syntax near '$¢icÍeÖ3?Ò­mX®""
> EèÓÊÊA*"("M0¤´è,¨
> ÚP#®ïsÂüÞ´+Ò÷jW6%e VdÁ' at line 2

www.php.net/addslashes

$q = "INSERT INTO item (bztext) ('" . addslashes(bzcompress($text,9)) .
"')";

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux