Igor Gariev (gariev) wrote in changelog,
Igor Gariev
gariev
changelog

[ljcom] r11219: minor bugfix: error "You have an error i...

Committer: gariev
minor bugfix: error "You have an error in your SQL syntax" is removed
U   trunk/htdocs/accountstatus_feedback.bml
Modified: trunk/htdocs/accountstatus_feedback.bml
===================================================================
--- trunk/htdocs/accountstatus_feedback.bml	2011-11-28 12:24:11 UTC (rev 11218)
+++ trunk/htdocs/accountstatus_feedback.bml	2011-11-28 14:23:14 UTC (rev 11219)
@@ -51,12 +51,12 @@
         push @vals, ($now, $u->id, $qkey, $POST{$qkey});
         push @bind, "(?,?,?,?)";
     }
-    my $bind = join(",", @bind);
+    if (@vals) {
+        my $bind = join(",", @bind);
+        my $dbh = LJ::get_db_writer();
+        $dbh->do("INSERT INTO deletion_feedback VALUES $bind", undef, @vals);
+    }
 
-    my $dbh = LJ::get_db_writer();
-
-    $dbh->do("INSERT INTO deletion_feedback VALUES $bind", undef, @vals);
-
     # Given a category, returns 1 if any qkey of that category was selected
     my $checkcategory = sub {
         my $cat = shift;

Tags: bml, gariev, ljcom
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments