List:General Discussion« Previous MessageNext Message »
From:Thimble Smith Date:July 22 1999 7:57pm
Subject:Re: SV: Binary fields
View as plain text  
>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.

Don't do that.  Use the functions that are designed to make this problem
something you never have to think about.

use DBI;

... connect ...

my $sth = $dbh->prepare("insert into blah values (?)")
    or die "can't prepare query: ", $dbh->errstr;
$sth->execute($pic)
    or die "can't execute query: ", $dbh->errstr;

Isn't that easy?

Tim
Thread
SV: Binary fieldsMartin Edelius22 Jul
  • Re: Binary fieldsFaisal Nasim22 Jul
  • Re: Binary fieldsBrian Huddleston22 Jul
  • Re: SV: Binary fieldsThimble Smith23 Jul