title: Setting the a WebPages Title with PHP and MySql database
body: <p>So I have a database the program runs fine connects and all except for one thing I am trying to get the "forum_name" defined under my db and set it as my Title. Pretty much if I click on the link where it takes me to that post or forum page it will get whats under forum_name and print it as the Title.</p>
  
  <p>This is db_connect.php</p>
  
  <pre><code>&lt;?php
  $db = new mysqli("localhost", "root", "","forum") or die("ERROR: With Connecetion");
   ?&gt;
  </code></pre>
  
  <p>And this is the Reset:</p>
  
  <pre><code>&lt;?php
  session_start();
  require"db_connect.php";
  //get the page id
  if(isset($_GET['id']) &amp;&amp;is_numeric($_GET['id'])){
      $id = $_GET['id'];
  }else{
      die("Error! Does not exist!");
  }
  //check if Valid Id
   $idCheck = $db-&gt;query("SELECT * FROM forum_tabl WHERE forum_id = 'id'");
   if($idCheck-&gt;num_rows !==0){
       die("error");
   }
   $row = $idCheck-&gt;fetch_object();
   $sql = "SELECT post_id, post_title FROM forum_post WHERE forum_id? AND type= 'o'";
   if($query = $db-&gt;prepare($sql)){
       $query-&gt;bind_params('s', $id);
       $query-&gt;bind_result($post_id, $post_title);
       $query-&gt;execute();
       $query-&gt;store_result();
   }
  ?&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta charset="utf-8"&gt;
  &lt;title&gt;&lt;?= $row-&gt;forum_name?&gt;&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  
  &lt;div id="container"&gt;
      &lt;!-- Theres content that will go here --&gt;
  &lt;/div&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>