Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fatal error: Call to undefined function mysql_real_escape_string() [closed]

Tags:

php

mysql

Fatal error: Call to undefined function mysql_real_escape_string() in /var/www/engine/database.php on line 38

I can still connect to the database however. Why is it not available?

I am using PHP version 7.1.4

like image 402
Jon Andrews Avatar asked Jun 23 '17 05:06

Jon Andrews


People also ask

What is the use of mysql_real_escape_string () function?

The real_escape_string() / mysqli_real_escape_string() function escapes special characters in a string for use in an SQL query, taking into account the current character set of the connection.

Is mysql_real_escape_string deprecated?

This extension was deprecated in PHP 5.5. 0, and it was removed in PHP 7.0.

Why is the use of Mysqli_real_escape_string () so important?

The aim of the function mysqli_real_escape_string is to try to ensure that the data that is sent to the mysql server is safe - it attempts to remove characters that are often used in sql injection.


1 Answers

mysql_ has been removed in php 7. try mysqli_real_escape_string instead of mysql_real_escape_string.

like image 139
Bhunesh Satpada Avatar answered Sep 22 '22 22:09

Bhunesh Satpada