mysql_real_escape_string wants a string or a "resource"?
mysql_real_escape_string wants a string or a "resource"?
am 11.07.2009 23:42:10 von Govinda
This code:
$maybeDeleteClient=($_GET["maybeDeleteClient"]);
$maybeDeleteClient=mysql_real_escape_string($db_billing,
$maybeDeleteClient); // this is line 53
gives this error:
"Warning: mysql_real_escape_string() expects parameter 2 to be
resource, string given in /home/metheuser/public_html/somedir/
billing_manageClients.php on line 53"
but the docs here:
http://us2.php.net/manual/en/mysqli.real-escape-string.php
say:
"Procedural style:
string mysqli_real_escape_string ( mysqli $link , string $escapestr )
"
...and even go on to give an example using a string for that 2nd param.
Why is it complaining to me?
p.s. what is a "resource" compared to a string?
------------
Govinda
govinda.webdnatalk@gmail.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: mysql_real_escape_string wants a string or a "resource"?
am 11.07.2009 23:46:45 von Stut
2009/7/11 Govinda :
> This code:
> $maybeDeleteClient=($_GET["maybeDeleteClient"]);
> $maybeDeleteClient=mysql_real_escape_string($db_billing,
> $maybeDeleteClient); // this is line 53
>
> gives this error:
> "Warning: mysql_real_escape_string() expects parameter 2 to be resource,
> string given in
> /home/metheuser/public_html/somedir/billing_manageClients.ph p on line 53"
>
> but the docs here:
> http://us2.php.net/manual/en/mysqli.real-escape-string.php
> say:
> "Procedural style:
> string mysqli_real_escape_string ( mysqli $link , string $escapestr )
> "
> ..and even go on to give an example using a string for that 2nd param.
>
> Why is it complaining to me?
You're looking at the documentation for mysqli_real_escape_string but
using mysql_real_escape_string - notice the i in mysqli in the first
function name.
> p.s. what is a "resource" compared to a string?
A resource is a variable type. See http://php.net/language.types.resource
-Stuart
--
http://stut.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: mysql_real_escape_string wants a string or a "resource"?
am 11.07.2009 23:51:53 von Daniel Brown
On Sat, Jul 11, 2009 at 17:46, Stuart wrote:
>
> You're looking at the documentation for mysqli_real_escape_string but
> using mysql_real_escape_string - notice the i in mysqli in the first
> function name.
For the longest time, we were having a problem in the docs where
some mirrors were erroneously redirecting references to
mysqli_real_escape_string() to mysql_real_escape_string(). Should all
be fixed now (and certainly is on the US2 mirror).
--
daniel.brown@parasane.net || danbrown@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Check out our great hosting and dedicated server deals at
http://twitter.com/pilotpig
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: mysql_real_escape_string wants a string or a "resource"?
am 11.07.2009 23:51:54 von Govinda
> You're looking at the documentation for mysqli_real_escape_string but
> using mysql_real_escape_string - notice the i in mysqli in the first
> function name.
right. Thanks.
>> p.s. what is a "resource" compared to a string?
>
> A resource is a variable type. See http://php.net/language.types.resource
as in a db connection
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: mysql_real_escape_string wants a string or a "resource"?
am 11.07.2009 23:58:26 von Stut
2009/7/11 Govinda :
>> You're looking at the documentation for mysqli_real_escape_string but
>> using mysql_real_escape_string - notice the i in mysqli in the first
>> function name.
>
> right. Â Thanks.
>
>>> p.s. what is a "resource" compared to a string?
>>
>> A resource is a variable type. See http://php.net/language.types.resourc=
e
>
> as in a db connection
That's one example of a resource, but in general terms it's a
reference to an external resource of some sort, specific to a
particular extension.
-Stuart
--=20
http://stut.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: mysql_real_escape_string wants a string or a "resource"?
am 11.07.2009 23:58:58 von Daniel Brown
On Sat, Jul 11, 2009 at 17:51, Govinda wrote:
>
> as in a db connection
That's essentially a resource in reference to an object.
--
daniel.brown@parasane.net || danbrown@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Check out our great hosting and dedicated server deals at
http://twitter.com/pilotpig
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: mysql_real_escape_string wants a string or a "resource"?
am 11.07.2009 23:59:45 von Govinda
> For the longest time, we were having a problem in the docs where
> some mirrors were erroneously redirecting references to
> mysqli_real_escape_string() to mysql_real_escape_string(). Should all
> be fixed now (and certainly is on the US2 mirror).
In my case, I had somehow got the idea that the docs were the same for
both functions. I.e. I knew I was looking at
mysqli_real_escape_string
but thought the syntax was the same as for
mysql_real_escape_string
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php