RE: [PHP-WIN] addslashes() and binary data

From: Date: Sun, 11 Feb 2001 23:33:45 +0000
Subject: RE: [PHP-WIN] addslashes() and binary data
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-5507@lists.php.net to get a copy of this message
try base64_encode($binary_data)... Ignatius > -----Original Message----- > From: Randall Barber [mailto:rdb55@email.byu.edu] > Sent: Saturday, 10 February 2001 12:23 > To: php-windows@lists.php.net > Subject: [PHP-WIN] addslashes() and binary data > > > 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 >

« previous php.windows (#5507) next »