title: PHP MySQL not inserting into database
body: <p>I have heard of this issue but can't seem to figure it out. I have the database and table names correct. I am not finding any errors and i even inserted a table myself on phpmyadmin that worked but when I tried to do it on my site it doesnt work. I even tested the connection..Not sure what to do now</p>
  
  <p>Maybe someone can take a look at my code and see if they notice anything</p>
  
  <pre><code>&lt;?php
  if(mysql_connect('&lt;db&gt;', '&lt;un&gt;', '&lt;pw&gt;') &amp;&amp; mysql_select_db('smiles'))
  {
  
      $time = time();
      $errors = array();
  
      if(isset($_POST['guestbook_name'], $_POST['guestbook_message'])){
          $guestbook_name = mysql_real_escape_string(htmlentities($_POST['guestbook_name']));
          $guestbook_message = mysql_real_escape_string(htmlentities($_POST['guestbook_message']));
  
          if (empty($guestbook_name) || empty($guestbook_message)) {
              $errors[] = 'All Fields are required.';
          }
          if (strlen($guestbook_name)&gt;25 || strlen($guestbook_message)&gt;255) {
              $errors[] = 'One or more fields exceed the character limit.';
          }
          if (empty($errors)) {
  
              $insert = "INSERT INTO 'guestbook'VALUES('','$time','$guestbook_name','$guestbook_message')"; 
              if($insert = mysql_query($insert)){
                  header('Location: '.$_SERVER['PHP_SELF']);
              } else{
                $errors[] = 'Something went wrong . Please try again.';
              }
          } else {
              foreach($errors as $error) {
              echo '&lt;p&gt;'.$error.'&lt;/p&gt;';
              }
          }
  
      }
      //display entries
  } 
  else {
      'Fixing idiot';
  }
        ?&gt; 
        &lt;hr /&gt;
         &lt;form action="&lt;?php echo htmlentities($_SERVER['PHP_SELF']);?&gt;" method="POST"&gt;
       &lt;p&gt;Post Somethign&lt;/p&gt;
        &lt;br /&gt;
            Name:&lt;br /&gt;&lt;input type="text" name="guestbook_name" maxlength="25" /&gt;
     &lt;br /&gt;
      Message:
      &lt;br /&gt;
             &lt;textarea name="guestbook_message" rows="6" coles="30"maxlength="255"&gt;&lt;/textarea&gt;
        &lt;input type="submit" value="Post" /&gt;
        &lt;/form&gt;
  </code></pre>