Re: mysql_real_escape_string wants a string or a "resource"?
| From: | Stuart | Date: | Sat, 11 Jul 2009 21:46:45 +0000 |
| Subject: | Re: mysql_real_escape_string wants a string or a "resource"? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-295242@lists.php.net to get a copy of this message | ||
2009/7/11 Govinda <govinda.webdnatalk@gmail.com>:
> 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?
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/