You need to use the quote method. MySQL is complaining because there is
some special character (like ') being passed in $pic.
So you would do something like:
$pic = $dbh->quote($pic);
and then
insert into blah values($pic)
(note the missing 's, the quote method will do that for you...)
(note also that this is from memory, so don't cut and paste this, just
lookup in quote method in the DBI docs).
*******************************
Brian Huddleston
Partner, Huddleston Consulting
brianh@stripped
*******************************
----- Original Message -----
From: Faisal Nasim <swiftkid@stripped>
To: Thimble Smith <tim@stripped>
Cc: <mysql@stripped>
Sent: Thursday, July 22, 1999 6:21 AM
Subject: Re: Binary fields
> : >It always returns an error!
> :
> : Which error? "MySQL server has gone away"? Look at the manual,
> : "Problems and common errors" for an answer.
>
> DBD::mysql::st execute failed: parse error near
'\'Á[èi)ßÁÚTÜBTU·z±ûG6(Z8ÂÚ˜ià4†ŽÛ-±$2ÛmçhCa½¨Æâ2'
at line 1 at test.pl
line 54.
>
> Actually, I passing it like this
>
> insert into blah values ( '$pic' )
>
> where $pic has the binary contents....
> I have also tried converting all ' to \' in $pic, that doesn't help.
>
>
> ---------------------------------------------------------------------
> Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
> posting. To request this thread, e-mail mysql-thread8083@stripped
>
> To unsubscribe, send a message to the address shown in the
> List-Unsubscribe header of this message. If you cannot see it,
> e-mail mysql-unsubscribe@stripped instead.