Re: addslashes/mysql_real_escape_string

> I have never had a memoryleakfrom mysql_real_escape_string(). =A0What
> version are you running?

5.2.5, but I'm not sure where to report this, mysql, php or pear :) I
managed to narrow it down to a simple repro, it only happens if I pass
a simplexml node to this function, which is actually an object. If I
cast it to string or something then it's working fine.
Gabest [ So, 30 März 2008 20:37 ] [ ID #1931814 ]

Re: addslashes/mysql_real_escape_string

Gabest wrote:
>> I have never had a memoryleakfrom mysql_real_escape_string(). What
>> version are you running?
>
> 5.2.5, but I'm not sure where to report this, mysql, php or pear :) I
> managed to narrow it down to a simple repro, it only happens if I pass
> a simplexml node to this function, which is actually an object. If I
> cast it to string or something then it's working fine.
>

mysql_real_escape_string() is not meant to be taking objects. It
requires a string. If you want to do this, you need a __tostring()
method in your class to convert to a string.

Or, if you want to bring it back out into a string later, you should
first serialize() the object, then after retrieval, unserialize() it.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex [at] attglobal.net
==================
Jerry Stuckle [ Mo, 31 März 2008 00:07 ] [ ID #1933023 ]
PHP » comp.lang.php » Re: addslashes/mysql_real_escape_string

Vorheriges Thema: memcache issue
Nächstes Thema: Re: Form helper issues "Invalid argument supplied for foreach()"