--- Dennis Cote <[EMAIL PROTECTED]> wrote:
> Clark Christensen wrote: > > >IOW, something like. > > > >$sql = "update t1 set a = ?"; > >$string = $dbh->quote( qq(some long string; has many > >'single quotes') ); > >$sth = $dbh->prepare($sql); > >$rc = $sth->execute($string); > > > >will probably eliminate both the prepare() error, and an > >UPDATE error later. > > > > -Clark > > > > > > > > > Clark, > > The arguments passed to sqlite as parameters should not > be quoted. These > strings do not pass through the parser, they are used as > literal values > when the SQL statement is executed. If you do quote this > string, the > quotes will be included in the value of field a in your > database. > > You'll have to excuse my PERL (it's not a language I > use)... but if > arguments to execute() are passed as parameters to sqlite > then you > should do something like this. > > $sql = "update t1 set a = ?"; > $string = "some long string; has many 'single quotes'"; > $sth = $dbh->prepare($sql); > $rc = $sth->execute($string); > > HTH > Dennis Cote > Even better. Thanks Dennis! -Clark