title: Flex & PHP: How to Use htmlspecialchars?
body: <p>I'm using Flex 3 with remoting to return data from a MySQL database. Do I need to use htmlspecialchars in order to keep my site secure? </p>
  
  <p>As I understand it, htmlspecialchars is used to "sanitize" data returned from the db. For example: </p>
  
  <pre><code>$query = "SELECT latitude, longitude FROM myTable WHERE type = '$type'";
  
              $result = mysql_query($query);
  
              $ret = array();
                   while ($row = mysql_fetch_object($result)) {
                      $tmp = new VOmyData();
                      $tmp-&gt;latitude = $row-&gt;latitude;
                      $tmp-&gt;longitude = $row-&gt;longitude;
                      $ret[] = $tmp; 
                          }
                   mysql_free_result($result);
  
                   return $ret;
  </code></pre>
  
  <p>How do I use it in the case above? </p>
  
  <pre><code>return htmlspecialchars($ret);
  </code></pre>
  
  <p>or do I write: </p>
  
  <pre><code>$result = htmlspecialchars($result);
  </code></pre>
  
  <p>or somtheing else?</p>