title: Fetch data from MYSQL and display in JSON file
body: <p>I'm building and iOS application which fetches data from my MYSQL database, so to do such thing i need to use JSON (i know other methods,but i need specifically to use JSON). The problem is, how can i fetch data from my mysql database and write it to file in JSON format (preferably using PHP).</p>
  
  <p>Any link,tutorial or source code will be much appreciated!</p>