Re: mysql_real_escape_string(0xffffffff) yields -1
| From: | LinuxManMikeC | Date: | Sat, 16 Jan 2010 18:12:49 +0000 |
| Subject: | Re: mysql_real_escape_string(0xffffffff) yields -1 | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-301151@lists.php.net to get a copy of this message | ||
On Fri, Jan 15, 2010 at 3:22 PM, Richard Lynch <ceo@l-i-e.com> wrote:
> The subject line says it all:
>
> mysql_real_escape_string(0xffffffff) yields -1
>
> What's up with that?
>
> Is there some way to convince mysql_real_escape_string to use BIGINT?
>
> I guess I'll just PCRE for digits and then pass it in and...
>
> But what if somebody passes in some BC Math number?...
>
Try passing it as a string literal, NOT a hexadecimal numeric literal.
mysql_real_escape_string('0xffffffff');
In case you haven't noticed, SQL statements are stored in strings.