title: how to get all the records from MySQL table in php web services
body: <pre><code>$sql=mysql_query("SELECT friendName,createdDate FROM friends where userId='$userId'");
  $result=mysql_fetch_assoc($sql);
  if(!empty($result))
  {
  $json=$result;
  }
  else
  {
  $json = array( "msg" =&gt; "No infomations Found");
  }
  header('Content-type: application/json');
  </code></pre>
  
  <p>I am trying the about code for getting all the values from database but only one record will come.please help me</p>