RE: [PHP] Sanitizing potential MySQL strings with no database connection
| From: | Andrea Giammarchi | Date: | Wed, 21 Oct 2009 11:45:58 +0000 |
| Subject: | RE: [PHP] Sanitizing potential MySQL strings with no database connection | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-299155@lists.php.net to get a copy of this message | ||
I so much avoid the silent char that sometimes I even forget this exists.
I guess it is worth it for this case.
Regards
> Date: Tue, 20 Oct 2009 21:28:06 +0200
> From: dotancohen@gmail.com
> To: php.net@emax.dk
> CC: ash@ashleysheridan.co.uk; php-general@lists.php.net
> Subject: Re: [PHP] Sanitizing potential MySQL strings with no database connection
>
> > if(@mysql_real_escape_string($variable) === false)
> >
>
> Perfect! The @ symbol suppresses the error and I can structure the
> code according to whether or not there is a connection.
>
> Thank you!
>
> --
> Dotan Cohen
>
> http://what-is-what.com
> http://gibberish.co.il
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
_________________________________________________________________
Keep your friends updated—even when you’re not signed in.
http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_5:092010