in reply to DBI using Hashes To Create

You probably don't want to send references to all those (thats what the \ is doing)

Try removing that and see what happens.


___________
Eric Hodges

Replies are listed 'Best First'.
Re^2: DBI using Hashes To Create
by barrycarlyon (Beadle) on Apr 28, 2006 at 23:00 UTC

    I should of mentioned that that was first choice, but since that didnt work I added the backslahes and that didnt work

    Error for no backslahes

    Fri Apr 28 23:59:48 2006 error Error executing run mode 'email_dpt': Can't insert new LSweb::Database::Email: DBD::mysql::st execute failed: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'to, from, subject, content, name)\nVALUES ('webamster@lsweb.org. for Statement "INSERT INTO email (to, from, subject, content, name)\nVALUES (?, ?, ?, ?, ?)\n" at /usr/lib/perl5/site_perl/5.8.6/DBIx/ContextualFetch.pm line 52.\n at /home/lsweb/public_html/perllib/LSweb/Database/Email.pm line 102\n at /dev/null line 0\n

    Barry Carlyon barry@barrycarlyon.co.uk
      "from" is a reserved word in SQL. I'm guessing "to" might be too.

      You should be using less bugprone column names, but you might try just putting backquotes ("`") around those column names. That's a way with Mysql to allow special characters, or reserved words, in column names. See quoting identifiers.

      Why did you add the backslashes? The error message suggests that the SQL syntax is invalid. That means that whatever LSweb::Database::Email does, either you're not using it right or it's not generating the correct code. Unless we can see it, we can't tell you which it is.

      Update: Yeah, we also need to see LSweb::DBI....