title: MySQL PHP syntax when trying to update a duplicate column's row
body: <p><strong>Desired behavior:</strong> I have a form that is designed to take data and put it into a mySQL table. The desired outcome is to have users enter their data, and if one submission in a particular column is submitted, the new data for the entire row will overwrite the old data.</p>
  
  <p><strong>Current behavior:</strong> I am getting a syntax error when the form is submitted.</p>
  
  <p><strong>Preliminary notes:</strong> I realize this code has potential for injection but the form consists only of dropdowns and a date picker (no open fields). Plus, this will be used for a very small organization with very little tech savvy.</p>
  
  <pre><code>$sql = "INSERT INTO $usertable (library, reason, closedate, opendate) VALUES 
  ('$library', '$reason', '$closedate', '$opendate')
         ON DUPLICATE KEY UPDATE reason=$reason(reason), 
  closeDate=$closedate(closedate), openDate=$opendate(opendate)";
  </code></pre>
  
  <p><strong>Error message:</strong> 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 'weather. (reason), closeDate=2018-07-18(closedate), openDate=2018-07-27(opendate' at line 2</p>
  
  <p><strong>Attempts to correct syntax:</strong> I have tried separating all of my ON DUPLICATE KEY parameters by parenthesis, apostrophes and both at the same time. I have also tried removing what is currently displayed in parenthesis out, because I have seen successful code work both ways.</p>
  
  <p>I would really appreciate any suggestions, thank you!</p>