Uncaught Error: Call to undefined function mysql_escape_string()
<blockquote>
  <p>Fatal error: Uncaught Error: Call to undefined function mysql_escape_string() in C:\xampp\htdocs\phoenixproject\register.php:16 Stack trace: #0 {main} thrown in C:\xampp\htdocs\phoenixproject\register.php on line 16</p>
</blockquote>

<p>How to fix this?</p>

<pre><code>&lt;?php
require("config.php");
?&gt;
&lt;?php
if(isset($_POST['submit'])){

$email1 = $_POST['email1'];
$email2 = $_POST['email2'];
$pass1 = $_POST['pass1'];
$pass2 = $_POST['pass2'];

if($email1 == $email2) {
    if($pass1 == $pass2) {
//All good. Nastavi broo.

$name = mysql_escape_string($_POST['name']);
$lname = mysql_escape_string($_POST['lname']);
$uname = mysql_escape_string($_POST['uname']);
$email1 = mysql_escape_string($email1);
$email2 = mysql_escape_string($email2);
$pass1 = mysql_escape_string($pass1);
$pass2 = mysql_escape_string($pass2);

mysql_query("INSERT INTO `users` (`id`, `name`, `lname`, `uname`, `email`, `pass`) VALUES (NULL, '$name', '$lname', '$uname', '$email1', '$pass1')") or die (mysql_error());



}else{
  echo "Sorry, your password is not corrext.";
  exit();
}
}else{
  echo "Sorry!";
}

} // brace for submit conditional

$form = &lt;&lt;&lt;EOT
&lt;form action="register.php" method="POST"&gt;
First Name: &lt;input type="text" name="name" /&gt;&lt;/br&gt;
Last Name: &lt;input type="text" name="lname" /&gt;&lt;/br&gt;
Username: &lt;input type="text" name="uname" /&gt;&lt;/br&gt;
Email: &lt;input type="text" name="email1" /&gt;&lt;/br&gt;
Confirm Email: &lt;input type="text" name="email2" /&gt;&lt;/br&gt;
Password: &lt;input type="password" name="pass1" /&gt;&lt;/br&gt;
Confirm Password: &lt;input type="password" name="pass2" /&gt;&lt;/br&gt;
&lt;input type="submit" value="Register" name="submit" /&gt;
&lt;/form&gt;
EOT;
echo $form;

?&gt;
</code></pre>

<p>Well I know that I was try to mix mysql and mysqli.... </p>