how to get a this format json from php my sql server?
<pre><code>{
"Magazine":
[
{
    "name": "CF",
    "title": "Magazine",
    "info": "explore life in all its depth and to be with each other. If you really...",
    "date": "2013-01-03 12:58:15",
    "cover": "http://zerozone.biz/mrv/ebook/mag/newsstand-books/magcover.png",
    "url": "http://zerozone.biz/Q_MAG_READER/magazine/livingnow-issue-156.zip",
   "product_id": "magazine/mag/index.html"
  }
]  
}
</code></pre>

<p>here i write a json format which i want i want to a <strong>magazine</strong> array in json file wich contain a json object.</p>

<p>when i try to get a json file then get a this format i want to above format.</p>

<pre><code>[
{
    "name": "CF",
    "title": "Magazine",
    "info": "explore life in all its depth and to be with each other. If you really...",
    "date": "2013-01-03 12:58:15",
    "cover": "http://\\zerozone.biz/\mrv/ebook/\mag/\newsstand-books/\magcover.png",
    "url": "http://\\zerozone.biz/\Q_MAG_READER/\magazine/\livingnow-issue-156.zip",
   "product_id": "magazine/\mag/\index.html"
  }
]
</code></pre>

<h2>php code</h2>

<pre><code>&lt;?php

$db_handle = mysql_connect('localhost','root' ,'') or die(mysql_error());
$db_found = mysql_select_db('reader', $db_handle) or die(mysql_error());




$query = mysql_query("SELECT * FROM q_mag");
$rows = array();
while($row = mysql_fetch_assoc($query)) {
    $rows[] = $row;
}
print json_encode($rows);
?&gt;  
</code></pre>

<p>plz write a php code for convert a data in json format from mysql server...</p>

<p>sorry for bad communication.</p>
