title: How do I make it check if the page is empty with MySQL?
body: <p>I'm back once again, trying to create a "custom" blog system. Or a CMS, as people call it. This is my current code:</p>
  
  <pre><code>&lt;?php
  //include stuff here
  $pid = $_GET['pageid'];
  $data = mysql_query("SELECT * FROM entries WHERE id='$pid'") or die("MySQL died.");
  mysql_real_escape_string($pid);
  while($info = mysql_fetch_array( $data )) 
  {
  if (!empty($info)) {
  echo $info['data'];
  }
  else {
  echo 'This page no existo.';
  }
  }
  ?&gt;
  </code></pre>
  
  <p>What's happening is that it's not showing "This page no existo." as the '404' text.
  Lets say someone is trying to go to my site directly typing it but make a mistake:
  localhost/blog/?pageid=10
  It doesn't show the 404 text!</p>
  
  <p>I have a row named "data" in MySQL. It consists of the-- um... data of the blog post. I also have a row called ID which is an auto increment ID system. The "real", working page ID is 1.</p>
  
  <p>Thanks,
  RBLXDev.</p>
  
  <p>EDIT:
  Vardump of $info:
  The vardump:</p>
  
  <pre><code>array (size=10)
  0 =&gt; string '1' (length=1)
  'id' =&gt; string '1' (length=1)
  1 =&gt; string 'Testing potatoCMS... and the title.' (length=35)
  'title' =&gt; string 'Testing potatoCMS... and the title.' (length=35)
  2 =&gt; string 'This is a test.
  This is a new line.
  This is a cookie.
  You are getting fat.
  FAT.&lt;br /&gt;lol' (length=88)
  'data' =&gt; string 'This is a test.
  This is a new line.
  This is a cookie.
  You are getting fat.
  FAT.&lt;br /&gt;lol' (length=88)
  3 =&gt; string '2013-02-02' (length=10)
  'date' =&gt; string '2013-02-02' (length=10)
  4 =&gt; string 'Unspecified' (length=11)
  'author' =&gt; string 'Unspecified' (length=11)
  </code></pre>
  
  <p>Yeah, um... I have weird placeholders.</p>