PHP 7 mysqli_real_escape_string() Error : <p>I update php 5 to php 7 quite recently.so that when i run the project it gives following error.</p>

<p><strong>Warning: mysqli_real_escape_string() expects exactly 2 parameters, 1 given in C:\xampp\htdocs\Project\Duplicate - Copy (2)\general.php on line 5</strong></p>

<p>Here is the Code.</p>

<pre><code>&lt;?php
function sanitize($data){   
    return mysqli_real_escape_string($data);
}
?&gt;
</code></pre>

<p>then i recoded connection like this.</p>

<pre><code>$db = new PDO('mysql:host=localhost;dbname=test;charset=utf8mb4', 'root', "");
</code></pre>

<p>can anyone help me please!</p>
