problem with mysql_real_escape_string()
-
I was looking at my PHP error log today and I see it filled with the following 2 errors:
PHP Warning: mysql_real_escape_string(): No connection could be made because the target machine actively refused it. in \MyWordPressFolder\wp-content\plugins\seo-redirection\common\util.php on line 61
PHP Warning: mysql_real_escape_string(): A link to the server could not be established in \MyWordPressFolder\wp-content\plugins\seo-redirection\common\util.php on line 61
So I took a look at like 61 and it is in the get_ref function where it is returning the clean HTTP referer URL using the mysql_real_escape_string. So is there a different function that can do the same without throwing out these connection errors? I read something about using mysqli_real_escape_string().
My PHP is a little rusty, I do mostly .NET stuff but it seems like the function is just needing to clean the URL to make sure it is safe to insert into a SQL command. Is there a reason that this simple function is trying to make a database connection? Is there a simple fix for this? Could it be that most people are running a local instance of MySQL and I am running MySQL on a separate dedicated server?
It seems to be logging these two errors every time a redirect is logged so my error log file is getting pretty large.
- The topic ‘problem with mysql_real_escape_string()’ is closed to new replies.