addslashes() and binary data
| From: | Randall Barber | Date: | Sat, 10 Feb 2001 01:23:02 +0000 |
| Subject: | addslashes() and binary data | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-5491@lists.php.net to get a copy of this message | ||
A curious man is me.
I have some binary data that I wish to insert into a database, and all examples I have seen have
used:
$to_save = addslashes($binary_data);
This is supposed to escape all the characters that databases don't like.
This function does not always work. Some times it is fine, other times it causes my SQL statement
to be completely wrong, or it evaluates the ('$to_save') variable as NULL and returns SQL
COUNT field incorrect.
Am I missing something? Can someone tell me how they guarantee that all the bad characters will be
escaped?
Thanks in advance
RDB