title: MYSQL INSERT INTO Produces An Error: You have an error in your SQL syntax
body: <p>I am trying to make a simple shoutbox for a school project.</p>
  
  <p>Everything seems to be working fine, except when i try and send a message. My sql query is simple, but seems to not be working for some reason.</p>
  
  <p><a href="https://i.stack.imgur.com/R9o2k.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/R9o2k.png" alt="database"></a></p>
  
  <pre><code>&lt;?php
  session_start();
  require_once("includes/connect.db.php");
  
  $sql = "SELECT * FROM shoutbox";
  $result = mysql_query($sql);
  
  echo '&lt;table border=1&gt;';
  while($rows = mysql_fetch_assoc($result)){
      $sb_username = $rows['username'];
      $sb_message = $rows['message'];
      $sb_sent_time = $rows['sent_time'];
      echo '&lt;tr&gt;&lt;td&gt;' . $sb_username . ': &lt;/td&gt;&lt;td&gt;' . $sb_message;
  }
  echo '&lt;/table&gt;';
  ?&gt;
  &lt;form method=post action=shoutbox.php&gt;
      &lt;input type=text name="message"&gt;
      &lt;input type=submit value="Send!"&gt;
  &lt;/form&gt;
  
  &lt;?php
  if(isset($_POST['message'])){
      $date = time();
      $message = mysql_real_escape_string(htmlentities($_POST['message']));
      $username = $_SESSION['user_name'];
      $sql = "INSERT INTO shoutbox ('username', 'message', 'time_sent') VALUES ('$username', '$message', '$date')";
      mysql_query($sql) or die(mysql_error());
  }
  
  ?&gt;
  </code></pre>
  
  <p>Produces the following error:
  You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''username', 'message', 'time_sent') VALUES ('c4sper', 'hello', '1461107151')' at line 1</p>