Where i am wrong on code web service php : <p>Where the code is wrong its giving me an error on mysql_assoc;</p>

<pre><code>if($_SERVER['REQUEST_METHOD'] == "POST"){
$sql=mysql_query("SELECT * FROM users");

$query = mysql_query($sql);
$json = array(); // create empty array
$i = 0; // start a counter
while($result=mysql_fetch_assoc($query)){ 
    $json[$i]['name'] = $result['name'];
    $json[$i]['email'] = $result['email'];
    $i++; 
}
if(count($json)&gt;0){ 
}else{
$json = array( "msg" =&gt; "No infomations Found");
}
header('Content-type: application/json');


}
</code></pre>

<p>this an error after running the service;</p>

<pre><code>&lt;br /&gt;
&lt;b&gt;Warning&lt;/b&gt;:  mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in &lt;b&gt;C:\xampp\htdocs\satyam\services\select.php&lt;/b&gt; on line &lt;b&gt;11&lt;/b&gt;&lt;br /&gt;
</code></pre>
