title: Resource id #5: MySQL
body: <pre><code>&lt;?php
  //Sessions starten
  session_start();
  //Include stuff
  include('conf.php');
  //'Shortcuts' maken
  $sname = $site['name'];
  $shost = $site['host'];
  $shostb = $site['hostb'];
  //Verbinding maken met DB
  $link = mysql_connect($database['host'], $database['username'], $database['password']) or die (mysql_error());
  mysql_select_db($database['db'],$link) or die(mysql_error());
  //Gegevens uit db halen
  if(isset($_GET['page'])){
      $page['title'] = mysql_query("SELECT title FROM pages WHERE page = $_GET[page]");
  }
  else{
      $page['title'] = mysql_query("SELECT title FROM pages WHERE page = 'index.php'");
  }
  ?&gt;
  &lt;!doctype html&gt;
  &lt;html lang="nl"&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8" /&gt;
      &lt;title&gt;&lt;?php echo $sname;?&gt;•&lt;?php echo $page['title']?&gt;&lt;/title&gt;
  </code></pre>
  
  <p>Does somebody know why this doesn't work? My DB structure is:</p>
  
  <blockquote>
    <h2>page     |title</h2>
    
    <p>index.php|index</p>
  </blockquote>
  
  <p>Sorry but I can't get this clear. The var <strong>dump</strong> of <code>$page['title'] = resource(5)</code> of type (mysql result). How can I fix this? Thanks for the help.</p>