Re: Single Quotes in Form Inputs
| From: | Niel Archer | Date: | Tue, 28 Jul 2009 05:43:25 +0000 |
| Subject: | Re: Single Quotes in Form Inputs | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-46359@lists.php.net to get a copy of this message | ||
> I prefer PHP Data Objects
> http://in3.php.net/manual/en/book.pdo.php to
> addslashes and mysql_real_escape_string
I prefer PDO myself. However, it is not necessarily safer. When using
prepared statements the parameters are automatically escaped similar to
mysql(i)_real_escape_string, if my reading of the documentation is
correct. But as far as I can tell no escaping is performed on PDO::query
or PDO::exec other than what you do yourself, so you have the same risks
that need to be addressed.
>
--
Niel Archer
niel.archer (at) blueyonder.co.uk