title: Code to real_escape all parameters clears all parameters
body: <p>I've used this PHP code to escape all the parameters which I pass:</p>
  
  <pre><code>&lt;?php
  
  foreach ($_GET as $key =&gt; $value) {
      if(!is_array($value)){
          $_GET[$key] = mysql_real_escape_string($value);
      }
  }
  
  $offset = (isset($_GET['offset']) ? $_GET['offset'] : null);
  
  echo "Offset is " . $offset;
  
  ?&gt;
  </code></pre>
  
  <p>In this example no matter what I pass as "offset" it returns "Offset is ". If I remove the foreach loop it returbs "Offset is Hello" (or whatever I pass).</p>
  
  <p>Why is the fornext loop losing the parameters - I've been using the code for months and it has always worked before!</p>