You are here:  » mysql_real_escape error


mysql_real_escape error

Submitted by shams995 on Mon, 2013-04-22 18:16 in

Hi,

I am getting the error "Deprecated: mysql_escape_string(): This function is deprecated; use mysql_real_escape_string() instead." in the database.php file when i upload or display data. Using the recommended method fails the whole thing.

Please help :)

Thanks

Submitted by support on Mon, 2013-04-22 22:51

Hi shams,

Thanks for that - apologies for any inconvenience. Please could you let me know what PHP version you are running? It is displayed on the Support Info page of your Price Tapestry /admin/ area - thanks.

In the mean time, you can suppress the warning by adding the following lines to the end of your config.php file, just before the closing PHP tag:

  error_reporting(0);
  ini_set('display_errors','off');

Cheers,
David.
--
PriceTapestry.com

Submitted by brimpton on Thu, 2013-05-09 20:21

David,

I'm having the same issue as shams995. I have the following support info:

Revision 13/03A Copyright (c) 2005-2013 IAAI Software, All Rights Reserved
PHP Version 5.4.13
MySQL Version 5.1.51-community

Did you ever find a solution to this? Simply changing the mysql_escape_string() function to mysql_real_escape_string() doesn't seem to help.

Kind regards

Brimpton

Submitted by support on Fri, 2013-05-10 08:19

Hi Brimpton,

mysql_real_escape_string() is also being deprecated as of 5.5, i'm not sure why using error_reporting() isn't working but I have read other reports of this being case under some circumstances.

Another option is to use function level warning suppression by prefixing with "@", so have a go with the following at line 65:

  return @mysql_real_escape_string($text);

However the real solution is to upgrade to the mysqli library, so today I will test and post a mysqli version of includes/database.php, and forward to you by email as soon as it's ready to save you having to keep checking back - apologies for any inconvenience of course;

Cheers,
David.
--
PriceTapestry.com

Submitted by johnbanny on Wed, 2013-05-29 11:04

Hi,

I am getting this same error too. Have not tried to fix it yet but was wondering if anyone had a reliable soloution

Thanks
John

Submitted by support on Wed, 2013-05-29 11:33

Hello John,

I have just posted a forwards compatibility patch for PHP version 5.5 or later, which replaces all existing MySQL library code with the new MySQLi object library versions....

Forward Compatibility Patch - PHP 5.5+

Cheers,
David.
--
PriceTapestry.com