title: json encode error in php
body: <p>I am new to PHP... I have been trying to encode the values retrieved from a MySQL database in JSON and then display the results on a browser..</p>
  
  <h3><code>mysqlcn.php</code></h3>
  
  <pre><code>mysql_connect("127.0.0.1","root","chetan");
  mysql_select_db("db1");
  $q=mysql_query("SELECT * FROM people WHERE birthyear&gt;'".$_REQUEST['year']."'");
  while($e=mysql_fetch_assoc($q))
  $output[]=$e;
  print(json_encode($output,JSON_FORCE_OBJECT));
  mysql_close();
  </code></pre>
  
  <p>When I try to run it in a browser using address <code>http://localhost/mysqlcn.php</code>, I get this:</p>
  
  <pre><code>{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\froman\fcharset0 
  Times New Roman;}{\f1\fswiss\fcharset0 Arial;}} {\*\generator Msftedit 
  5.41.15.1507;}\viewkind4\uc1\pard\sb100\sa100\f0\fs24\par \par \f1\fs20\par
  \par }
  </code></pre>
  
  <p>I am currently using WAMP server with PHP 5.3.0</p>
  
  <h3>SQL schema</h3>
  
  <pre><code>CREATE TABLE people (
  id INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
  name VARCHAR( 100 ) NOT NULL ,
  sex BOOL NOT NULL DEFAULT '1',
  birthyear INT NOT NULL)
  </code></pre>