Re: mysql_real_escape_string(0xffffffff) yields -1
| From: | Shawn McKenzie | Date: | Sat, 16 Jan 2010 20:13:31 +0000 |
| Subject: | Re: mysql_real_escape_string(0xffffffff) yields -1 | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-301153@lists.php.net to get a copy of this message | ||
LinuxManMikeC wrote:
> 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.
And mysql_real_escape_string() expects a string as an argument.
--
Thanks!
-Shawn
http://www.spidean.com