For Programmers: Free Programming Magazines  


Home > Archive > PHP SQL > February 2006 > whats with the `quotes` ?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author whats with the `quotes` ?
Tony Peardon

2006-02-27, 6:59 pm

Hi all. I've noticed people encasing their table and column names within
quotes. Whats up with that? my db seems to be working ok so far without
them, so what are they for? Should I be doing the same?



Andy Hassall

2006-02-27, 6:59 pm

On Mon, 27 Feb 2006 22:51:19 GMT, "Tony Peardon" <rWorldDesigns@yahoo.ca>
wrote:

>Hi all. I've noticed people encasing their table and column names within
>quotes. Whats up with that? my db seems to be working ok so far without
>them, so what are they for? Should I be doing the same?


No. You only need `` around table and column names if they have spaces or in
them, or clash with reserved words.

You should only use `` if you need it.

But if you need to use ``, your table or column is named wrongly, and should
be renamed so you don't need to use ``.

(And the standard way to quote weird table/column names is with double quotes
anyway - backticks are MySQL-specific.)

--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com