title: Perl MySQL INSERT error
body: <p>I'm trying to parse a few references from a file and load them into a MySQL table, but I keep on getting this error everytime I run the script</p>
  
  <pre><code>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 ' Njuguna, M.I., Yusuf, J. A., Akama, V.,2013,Animal husbandry in the developed w' at line 1 at manuscripts3.pl line 51, &lt;$fh&gt; line 1.
  </code></pre>
  
  <p>Uncaught exception from user code</p>
  
  <p>See my code below.</p>
  
  <p>I'm at my wits end. What am I doing wrong?</p>
  
  <pre><code>#!/usr/bin/perl
  
  use strict;
  use warnings;
  use diagnostics;
  
  use DBI;
  
  my $driver   = "mysql";
  my $database = "test";
  my $user     = "root";
  my $password = "";
  
  my $dbh      = DBI-&gt;connect(
    "DBI:$driver:$database",
    $user,
    $password, {
      RaiseError =&gt; 1,
      PrintError =&gt; 1,
      AutoCommit =&gt; 0,
    }
  ) or die $DBI::errstr;
  
  my $file = "/var/www/manuscripts.txt";
  
  open my $fh, "&lt;", $file;
  my @manuscripts;
  
  while (my $lines = &lt;$fh&gt;) {
    $lines =~ s/\, \(/\t/g;
    $lines =~ s/\) \“/\t/g;
    $lines =~ s/\” /\t/g;
  
    my ($authors, $year, $title, $journal) = split(/\t/, $lines);
  
    push @manuscripts, {
      authors =&gt; $authors,
      year    =&gt; $year,
      title   =&gt; $title,
      journal =&gt; $journal
    };
  
    #print "$title\n";
    my $sql = "insert into manuscript($authors,$year,$title,$journal) values (?,?,?,?)";
    $dbh-&gt;commit();
    my $stmt = $dbh-&gt;prepare($sql);
    $stmt-&gt;execute($authors, $year, $title, $journal);
  
    # disconnect from the MySQL database
    $dbh-&gt;disconnect();
  }
  
  #print $manuscripts[0][2];
  </code></pre>
  
  <p>text file:</p>
  
  <pre><code>Kamau, M.A., Njuguna, M.I., Yusuf, J. A., Akama, V., (2013) “Animal husbandry in the developed world” Journal of Hospital Infenction
  Kamau, M.A., Njuguna, M.I., Yusuf, J. A., Akama, V., (2013) “Agriculture and global warming” PLOS Medicine Kamau, M.A., Njuguna,
  M.I., Yusuf, J. A., Akama, V., (2013) “Rotational farming as a business” The Journal of Infectious Diseases
  </code></pre>