title: my guestbook will not display the posts i enter
body: <p>I want to thank you in advance for helping me with my related issue. The thing is my guestbook is getting the data into the database so it is connecting but when i hit submit the data goes to the database but does not display i am not sure as this maybe be a version conflict. I was watching YouTube in creating this guestbook but not sure what version the guy that created the guestbook. Everything works except the display of the post. I was wondering if you guys could help me with this and i will post code below.</p>
  
  <pre><code>&lt;?php error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED); ?&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;meta charset="UTF-8"&gt;
          &lt;title&gt;Title of the document&lt;/title&gt;
      &lt;/head&gt;
  
  
      &lt;body&gt;
  &lt;?php
  // connect to the database
  mysql_connect('localhost', 'root', '');
  mysql_select_db('tutorials');
  
  
  /* * ************************************************* */
  // form and add stuff area
  
  echo "&lt;h3&gt; Enter posts to GuestBook &lt;/h3&gt;";
  
  if ($_POST['postbtn']) {
  
      $name = strip_tags($_POST['name']);
      $email = strip_tags($_POST['email']);
      $message = strip_tags($_POST['message']);
  
      if ($name &amp;&amp; $email &amp;&amp; $message) {
  
  
          $time = date("h:i A");
          $date = date("F d, Y");
          $ip = $_SERVER['REMOTE_ADDR'];
  
          // add to the database
          mysql_query("INSERT INTO guestbook VALUES ( '', '$name', '$email', '$message', '$time', '$date', 'ip'
              )");
  
          echo "Your post has been added.";
      } else {
  
          echo "You did not enter in all the required information";
      }
  }
  echo "&lt;form action = './guestbook.php' method = 'post'&gt;
  
      &lt;table&gt;
  
  
          &lt;tr&gt;
  
              &lt;td&gt;Name:&lt;/td&gt;
              &lt;td&gt;&lt;input type = 'text' name = 'name' style = 'width: 300px;' /&gt;&lt;/td&gt;
  
          &lt;/tr&gt;
          &lt;tr&gt;
  
              &lt;td&gt;Email:&lt;/td&gt;
              &lt;td&gt;&lt;input type = 'text' name = 'email' style = 'width: 300px;' /&gt;&lt;/td&gt;
  
          &lt;/tr&gt;
          &lt;tr&gt;
  
              &lt;td&gt;Message:&lt;/td&gt;
              &lt;td&gt;&lt;textarea  name = 'message' style = 'width: 300px; height: 300px;'&gt;&lt;/textarea&gt;&lt;/td&gt;
  
          &lt;/tr&gt;
          &lt;tr&gt;
  
              &lt;td&gt;&lt;/td&gt;
              &lt;td&gt;&lt;input type = 'submit' name = 'postbtn' value = 'Post' /&gt;&lt;/td&gt;
  
          &lt;/tr&gt;
  
  
      &lt;/table&gt;
  
  
  
  
      &lt;/form&gt;";
  
  /* * ************************************************ */
  //display stuff area
  
  echo "&lt;h3&gt; Current Posts &lt;/h3&gt;";
  $query = mysql_query("SELECT * FROM guestbook ORDER BY id DESC");
  
  $numrows = mysql_num_rows($query);
  
  if ($numrows &gt; 0) {
      echo "&lt;hr /&gt;"; //echoing out the top horizontal line    
      while ($rows = mysql_fetch_assoc($query)) {
  
          $id = $row['id'];
          $name = $row['name'];
          $email = $row['email'];
          $message = $row['message'];
          $time = $row['time'];
          $date = $row['date'];
          $ip = $row['ip'];
  
  
          //nl2br new line to break function
          $message = nl2br("message");
  
          echo "&lt;div&gt;
  
              By &lt;b&gt;$name&lt;/b&gt; - at &lt;b&gt;$time&lt;/b&gt; on &lt;b&gt;$date &lt;/b&gt;&lt;br /&gt;
              $message
          &lt;/div&gt; &lt;hr /&gt;";
      }
  } else {
  
      echo "No posts were found.";
  }
  
  mysql_close();
  ?&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>