Re: occasional mcrypt problems
| From: | Steve Yates | Date: | Sat, 18 Jan 2003 11:34:20 +0000 |
| Subject: | Re: occasional mcrypt problems | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-132084@lists.php.net to get a copy of this message | ||
"Steve Yates" <steve@teamITS.com> wrote in message
news:20030117193854.47374.qmail@pb1.pair.com...
> After much testing, I think I may have it. It appears that MySQL is
> dropping a trailing space from the value being inserted into the database!
> For example if the encrypted string is "(.A®¢m¸"¼'À " MySQL stores
> the
> value without the trailing space (and it is a space). Why is that?
As with many "bugs" it's because I told it to! To my surprise, MySQL
varchar fields have their trailing spaces removed on insertion. Tinyblob or
Tinytext fields do not, so one needs to use those (or their larger brethren)
when saving encrypted or binary data to MySQL. Thanks to those who tried to
help!
- Steve Yates
- Computers make very fast, very accurate mistakes.
~ Taglines by Taglinator - www.srtware.com ~