note 53127 deleted from function.mysql-escape-string by danbrown
| From: | danbrown@php.net | Date: | Wed, 12 Aug 2009 21:48:52 +0000 |
| Subject: | note 53127 deleted from function.mysql-escape-string by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-159408@lists.php.net to get a copy of this message | ||
Note Submitter: steve at tequilasolutions dot com
----
Also... (see previous) I don't bother because my blobs are always multimedia files so
don't compress well but if you were storing word docs etc adding compression into the mix saves
space and will often be smaller than the original data.
e.g, - off the top of my head this, not syntax checked
$x = enc($mydata);
mysql_query("insert into table values('$x')");
function enc($x){
return base64_encode(bzcompress(serialize($x),9));
}
function dec($x){
return unserialize(bzdecompress(base64_decode($x)));
}