Why use ` around table names? php/mysql

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

ody
Forum Contributor
Posts: 147
Joined: Sat Mar 27, 2004 4:42 am
Location: ManchesterUK

Post by ody »

Well I just implemented a new module in the system I develop.. I use replication to two slaves (MySQL) and the slaves are V5 the master V4, and once apon a time I thought the use of backticks was overkill.. untill today. Turns out a simple addition of a reserved word in V5 did not effect offcourse the master V4 but caused the halt of both replicaton servers that keep the running backups.. I eat my own hat. Use the backticks!
mikebr
Forum Contributor
Posts: 243
Joined: Sat Sep 28, 2002 7:05 am

Post by mikebr »

I now use back ticks in all my queries and have been since the time I got replies to my post... always!

Thanks for the warning.
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post by CoderGoblin »

We had a situation once where backticks were required using Postgres. The reason, simply mixing upper and lowercase in table names. Hence we now always use all lowercase. Haven't run into any problems. I have heard ORACLE requires all uppercase characters for tablenames though...
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

Yep, i pretty much always use backticks now, after i moved an application from one server to another which required backticks for queries to work.

Not a bad habit to get into
Post Reply