February 12th, 2013, 04:36 AM
Get an error related to table does not exist in mysql
I have two tables named tmpGraph and tmpSummary. In the development environment, my team able to retrieve data from these two tables. We used tmpGraph and tmpSummary as stated in the class diagram in our sql codes. However, once we upload our code into server, all of our codes produced error related to these two tables.
I asked my db designer how he created the physical db, he said he followed the class diagram including exact spelling of each table names.
We checked physical db on server and our workstation using phpMyAdmin, the tables spelled as followed: tmpgraph and tmpsummary. But how come, we did not encounter this problem at development environment but our code produced error once we upload to server?
Last edited by wackyflik; February 12th, 2013 at 06:16 PM.
February 12th, 2013, 04:46 AM
whether or not table names are case sensitive depends on the operating system and the MySQL configuration. So using anything other than lowercase is simply a bad idea (although many people seem to love playing with leTtEr StYlE).
February 12th, 2013, 05:56 AM
Except that proper use of mixed case aids readability.
Originally Posted by Jacques1
The moon on the one hand, the dawn on the other:
The moon is my sister, the dawn is my brother.
The moon on my left and the dawn on my right.
My brother, good morning: my sister, good night.
-- Hilaire Belloc
February 12th, 2013, 07:16 AM
That's what the underscore is for.
February 12th, 2013, 12:02 PM
no it does not
Originally Posted by SimonJM
February 12th, 2013, 06:17 PM
thanks for the reply guys. So all of you suggesting table name with underscore instead of mixing uppercase and lowercase characters?
February 12th, 2013, 08:07 PM
All? no. A majority? yes.
As someone who has recently had to migrate an application with a 300 table database using mixed case table names from a Windows server to a Linux server, I highly highly highly recommend that you always use only lowercase table names with underscores.