title: Display SQL data in PHP
body: <p>Hi users of Stack Overflow,</p>
  
  <p>I am facing a issue where my SQL data won't display properly and I am not sure on how to fix this problem. I only see the print section with no appropriate data.</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
   &lt;link rel="stylesheet" href="css/default.css" type="text/css" /&gt;
   &lt;link rel="stylesheet" href="css/timetable.css" type="text/css" /&gt;
  &lt;title&gt;Timetable Information&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  
  &lt;div id="header"&gt;&lt;/div&gt;
  
  
  &lt;ul id="NavigationList"&gt;
  &lt;li&gt;&lt;a href="Index.php"&gt;Index&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="ModuleInfo.php"&gt;Module Info&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="ModuleSearch.php"&gt;Module Search&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="Timetable.php"&gt;Timetable Search&lt;/a&gt;&lt;/li&gt;
  
  &lt;/ul&gt;
  &lt;p&gt;
  &lt;p&gt;Please select a school from the drop-down list.&lt;/p&gt;
  
     &lt;?php
  require('json.php');
  error_reporting(E_ALL);
  $connection = mysql_connect('localhost', 'root','') or
      die("Could not connect: " . mysql_error());
  mysql_select_db("timetable") or die("No such database");
  $sql = sprintf("
    SELECT id,day,start,module
      FROM event JOIN teaches ON (event.id=teaches.event)
     WHERE staff='%s'", mysql_real_escape_string($_REQUEST['staff']));
  $result = mysql_query($sql)
    or die(mysql_error());
  while ($row = mysql_fetch_array($result)){
      print "&lt;div&gt;$row[id] $row[module] $row[day] $row[start]&lt;/div&gt;\n";
  }
  ?&gt;
  &lt;/p&gt;
  &lt;div id="Footer"&gt;
              &lt;p id="FooterText"&gt;Copyright &amp;copy; 2012 .&lt;br     /&gt;All     rights reserved.&lt;/p&gt;    
              &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>