in reply to DBI: error in SQL syntax.

Looks like an SQL problem. Print out the SQL statement before you run it, and try typing it manually into the mysql client, replacing the ?'s with the quoted values. That should help you track down the source of the problem.

Your mysql log may also contain what statements are being executed, which could give you further insight.