Re: Enclosing fields in MySQL queries with `" or '

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dotan Cohen wrote:
Are there any advantages/disadvantages to using and of the ` " or '
punctuation symbols in MySQL queries? I usually only put them around
variables (after being sanitized, of course):

INSERT INTO places (country, city) VALUES ('$country', '$city')

Any thoughts on the issue? Thanks.


Single quotes are supported in any db (mysql, postgres, sqlite etc etc) - so use them. No idea if double quotes are widely supported.

A backtick (`) on the other hand is a mysql-ism. It allows you to use keywords as field names (eg `index`) amongst other things (including quoting strings).

--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux