Re: php.ini not being read in vista
..oO(Jerry)
>Michael Fesser wrote:
>>
>> Besides the other responses: Why do you want to turn them on?
>> Magic quotes are broken and will be completely removed in PHP 6.
>> There's no reason to use them.
>
>well, the shared hosting server had them enabled.
>
>But this morning, I determined how to disable them on the server
>and so now I am going with magic_quotes_gpc disabled
Good.
>and using
>mysql_real_escape_string() for every INSERT and SELECT to MySQL
>(those are all the MySQL that I use.)
You should also consider to use PDO and prepared statements instead.
On the long run this will be the much more flexible and powerful way.
>So: the PHP manual page on "mysql_real_escape_string" gives the
>following example. My question: why are numbers or numeric
>strings deliberately not escaped?
If you've checked that the value is a number actually, you don't have to
escape it, simply because a number can't do any harm to the database.
Strings OTOH may contain characters that have a special meaning in an
SQL query. If you want the DB to interpret those chars literarily, you
have to escape them. That's what mysql_real_escape_string() does.
Micha
|