What's wrong with my code?
This is the code: <?php session_start(); $db = mysqli_connect("localhost", "root", "", "authentication"); if (isset($_POST['register_btn'])) { session_start(); $username=mysql_real_escape_string($_POST['username']); $email=mysql_real_escape_string($_POST['email']); $password=mysql_real_escape_string($_POST['password']); $password2=mysql_real_escape_string($_POST['password2']); if ($password==$password2) { $password=md5($password); $sql="INSERT INTO users(username, email, password) VALUES('$username', '$email', '$password')"; msqli_query($db, $sql); $_SESSION['message'] = "You are now logged in"; $_SESSION['username'] = $username; header("location:game.html"); } else{ $_SESSION['message'] = "The two passwords do not match"; } } ?> When I open in localhost show me this error: Fatal error: Uncaught Error: Call to undefined function mysql_real_escape_string() in C:\Users\Paul\Downloads\desktop\paul\htdocs\registration form\register.php:5 Stack trace: #0 {main} thrown in C:\Users\Paul\Downloads\desktop\paul\htdocs\registration form\register.php on line 5