×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: The mysql_real_escape_string() error

The mysql_real_escape_string() error 15 years 9 months ago #2689

  • Helly
  • Helly's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 29
  • Thank you received: 8
Hey,

I have used to search button so i can give an overview of what you need to know:

Database Version: 5.0.45
Database Collation: utf8_general_ci
PHP Version: 5.2.8-pl1-gentoo
dbtype 'mysqli'

Still i get this error while posting

<b>Warning</b>: mysql_real_escape_string() expects parameter 2 to be resource, object given in <b>/hosting/sites/ww3.vegetarisme.be/htdocs/components/com_comment/joscomment/utils.php</b> on line <b>678</b><br />
<br />
<b>Warning</b>: mysql_real_escape_string() expects parameter 2 to be resource, object given in <b>/hosting/sites/ww3.vegetarisme.be/htdocs/components/com_comment/joscomment/utils.php</b> on line <b>678</b><br />

Help would be appreciated.
Thanks allready

Greetings

The mysql_real_escape_string() error 15 years 9 months ago #2691

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Online
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hey there!

Hm it is strange
function mysql_escape_string($value)
	{
	    $database =& JFactory::getDBO();
 
//		$database->getEscaped($value);	
		/* getEscaped does not work always for some configurations... strange -> Character problem. empty comment */               
		$result = mysql_real_escape_string( $value, $database->_resource );
		return $result;			
	}

this comment

/* getEscaped does not work always for some configurations... strange -> Character problem. empty comment */

is not written for me and I don't believe that this is true. I've looked the mysql and mysqli files and they have implemented both the function as it should be implemented.
So please make the following test for me. Change the above function to this:
function mysql_escape_string($value)
	{
	    $database =& JFactory::getDBO();
 
		$result = $database->getEscaped($value);	
		/* getEscaped does not work always for some configurations... strange -> Character problem. empty comment */               
		//$result = mysql_real_escape_string( $value, $database->_resource );
		return $result;			
	}

and let me know if this is working for you.

The mysql_real_escape_string() error 15 years 9 months ago #2692

  • Helly
  • Helly's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 29
  • Thank you received: 8
it works thx :)
this made my day :D

case solved.
  • Page:
  • 1
Time to create page: 0.106 seconds