title: Php 5.4 to 7.1 : Mysqli_real_escape_string() 2 parameters, 1 given in
body: <p>Im trying to convert my Wordpress theme from PHP 5.4 to 7.1</p>
  
  <p>But... I still don't understand what's happening with this error :</p>
  
  <blockquote>
    <p><b>Warning</b>:  mysqli_real_escape_string() expects exactly 2
    parameters, 1 given in
    <b>/home/myhost/wp-content/themes/mytheme/functions.php</b> on line
    <b>69</b><br /></p>
  </blockquote>
  
  <pre><code>$con = new mysqli('localhost', 'my_user', 'my_password', 'my_db');
  
  
  function cG($name){
      if(get_magic_quotes_gpc()) $_GET[$name]=stripslashes($_GET[$name]); 
      $name=mysqli_real_escape_string($con, $_GET[$name]);
      return $name;
  }
  </code></pre>
  
  <p>I tried to follow <a href="https://stackoverflow.com/questions/25636975/warning-mysqli-real-escape-string-expects-exactly-2-parameters-1-given-wh">this</a>, but even I get the error... Any idea ? Thank you!</p>