title: Inserting data to database returning as <br /> <font size='1'><table class='xdebug-error
body: <p>Hi I am having a problem whenever I execute the submit of the form to the database. It does submit the data to the form but it is an error instead of the data that was inserted.
  <strong>index.php</strong></p>
  
  <pre><code>&lt;div id="postForm"&gt;
      &lt;!-- Username of the user posting the Language Learning Object --&gt;
      &lt;div id="postUserName" data-role="field-contain"&gt;
          &lt;label for="Username of user"&gt;Username of user &lt;/label&gt;
          &lt;input type="text" name="post_username" value="&lt;?php echo $_SESSION['post_username']; ?&gt;" readonly="readonly" id="post_username"/&gt;
      &lt;/div&gt;
  
      &lt;!-- Word of the language learning object --&gt;
      &lt;div id="postWord" data-role="field-contain"&gt;
          &lt;label for="Word for Language Learning Object"&gt;Word for Language Learning Object &lt;/label&gt;
          &lt;input type="text" name="post_word" id="post_word" /&gt;
      &lt;/div&gt;
  
      &lt;!-- Description of the word --&gt;
      &lt;div id="postDescription" data-role="field-contain"&gt;
          &lt;label for="Word description"&gt;Word description &lt;/label&gt;
          &lt;textarea name="word_description" id="word_description"&gt;&lt;/textarea&gt;
      &lt;/div&gt;
  
      &lt;!-- Categorization of the given word --&gt;
      &lt;div id="postCategorization" data-role="field-contain"&gt;
          &lt;label for="Categorization of Word"&gt;Categorization of Word &lt;/label&gt;
          &lt;select name="word_categorization" id="word_categorization"&gt;
              &lt;option value=""&gt; Select &lt;/option&gt;
              &lt;option value="Adverb"&gt; Adverb &lt;/option&gt;
              &lt;option value="Adjective"&gt; Adjective &lt;/option&gt;
              &lt;option value="Noun"&gt; Noun &lt;/option&gt;
              &lt;option value="Verb"&gt; Verb &lt;/option&gt;
          &lt;/select&gt;
      &lt;/div&gt;
  
      &lt;!-- Origin of the given word --&gt;
      &lt;div id="postOrigin" data-role="field-contain"&gt;
          &lt;label for="Origin of Word"&gt;Origin of Word &lt;/label&gt;
          &lt;input type="text" name="word_origin" id="word_origin" /&gt;
      &lt;/div&gt;
  
      &lt;!-- Getting the user's location --&gt;
      &lt;div id="userLocation" data-role="field-contain"&gt;
          &lt;label for="user location"&gt;User location&lt;/label&gt;
          &lt;input type="text" name="user_loc" value="&lt;?php echo $geo-&gt;city;?&gt;" /&gt;
      &lt;/div&gt;
  
      &lt;!-- Submit Button --&gt;
      &lt;div id="submitPost" data-role="field-contain"&gt;
          &lt;button name="submit_post" type="submit" id="submit_post"&gt;Create post&lt;/button&gt;
      &lt;/div&gt;
  &lt;/div&gt; &lt;!-- end of Form --&gt;
  </code></pre>
  
  <p><strong>post.php</strong></p>
  
  <pre><code>&lt;?php
  
  include_once( 'connect.php' );
  
  class ManagePost {
  
      protected $link;
  
      /* Connection to database */
      function __construct(){
          $db_connect = new ManageDatabase;
          $this-&gt;link = $db_connect-&gt;databaseconnect();
          return $this-&gt;link;
      }
  
      /* creating language learning objects/posts */
      function addPost($username,$word,$description,$categorization,$origin,$user_loc,$date,$time) {
          $query = $this-&gt;link-&gt;prepare("INSERT INTO post (username, word, description, categorization, origin, user_loc, date, time) VALUES (?,?,?,?,?,?,?,?)");
              $values = array($username,$word,$description,$categorization,$origin,$user_loc,$date,$time);
  
          $query-&gt;execute($values);
          $rowCount = $query-&gt;rowCount();
  
          return $rowCount;
      }
  }
  </code></pre>
  
  <p><strong>dbpost.php</strong></p>
  
  <pre><code>&lt;?php
  
      session_start();
      include('../class/post.php');
      $post_init = new ManagePost;
  
      if($_POST)
      {
          $username           = $_POST['post_username'];
          $word               = $_POST['post_word'];
          $description        = $_POST['word_description'];
          $categorization     = $_POST['word_categorization'];
          $origin             = $_POST['word_origin'];
          $user_loc           = $_POST['user_loc'];
          $date               = date("Y-M-D");
          $time               = date ("H:i:s");
  
          $submit_post = $post_init-&gt;addPost($username, $word, $description, $categorization, $origin, $user_loc, $date, $time);
  
          if($submit_post == 1)
          {
              echo 'true';
          }
          else
          {
              echo 'failed to submit';
          }
      }
  ?&gt;
  </code></pre>
  
  <p><strong>createpost.js</strong></p>
  
  <pre><code>$('form').submit(function() {
  
      if(validateWord() &amp;&amp; validateDescription() &amp;&amp; validateCategorization() &amp;&amp;  validateOrigin())
      {
          $.post('lib/dbpost.php', $('form').serialize(), function(response) {
              if(response == 'true')
              {
                  showSuccess('Post submitted');
              }
              else
              {
                  showError(response);
              }
          })
      }
  });
  </code></pre>
  
  <p>When I check the table post in phpMyAdmin it just shows as errors like this </p>
  
  <pre><code>&lt;br /&gt;&lt;font size='1'&gt;&lt;table class='xdebug-error xe 
  </code></pre>
  
  <p>in the attributes </p>
  
  <pre><code>"word, description, origin, and user_loc"
  </code></pre>