perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rodney Broom" <>
Subject Re: error DBI with quote
Date Mon, 10 Jul 2000 18:04:09 GMT
Ack! I can't find the string "not valid sentence" in, Apache/, or
in, so I'll ignore it.

Here's your code:

      $phrase = "Mike's car"
      my $insert_phrase=$dbh->prepare($sql);

There are several little problems it this chunk that lead me to believe that
this was not copy-n-pasted from the actual code. But who cares, try this:

      $phrase = "Mike's car"
      #-- The return from prepare() is a statement handle
      my $insert_sth = $dbh->prepare($sql);

That's it, just pass a list of values into execute(). As for Michael's comment
of not being sure whether you can use prepare() for non-SELECT-statements, the
answer is yes. In fact, all statements have to be prepare()ed when using DBI,
it's just a matter of who does the prepare(), you or DBI.

Rodney Broom

View raw message