Firstly, check which version of PHP you are using at your server.
Since the php function “mysql_real_escape_string” is only works for PHP 4 >= 4.3.0, and PHP5. If your PHP version is not among the version mentioned and newer then that, you should to use the MySQLi or PDO_MySQL extension instead since the extension was deprecated as of PHP 5.5.0.
There is an example , change your “mysql_real_escape_string” :
$content = mysql_real_escape_string($html_content);
To Procedural style
$conn = mysqli_connect(“localhost”,”root”,” password”,”test”);Or Object oriented style
//<-- This line is for showing where is the value $conn from
$content = mysqli_real_escape_string($conn, $html_content);
$conn = mysqli_connect(“localhost”,”root”,” password”,”test”);Reference:
//<-- This line is for showing where is the value $conn from
$content = $conn->real_escape_string ($html_content);
http://php.net/mysql_real_escape_string
http://php.net/manual/en/mysqli.real-escape-string.php
No comments :
Post a Comment