#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2004
    Posts
    260
    Rep Power
    0

    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.
  2. #2
  3. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,959
    Rep Power
    1014
    Hi,

    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).
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2006
    Posts
    2,448
    Rep Power
    1751
    Originally Posted by Jacques1
    Hi,

    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).
    Except that proper use of mixed case aids readability.
    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
  6. #4
  7. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,959
    Rep Power
    1014
    That's what the underscore is for.
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".
  8. #5
  9. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,178
    Rep Power
    4274
    Originally Posted by SimonJM
    Except that proper use of mixed case aids readability.
    no it does not

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2004
    Posts
    260
    Rep Power
    0
    thanks for the reply guys. So all of you suggesting table name with underscore instead of mixing uppercase and lowercase characters?
  12. #7
  13. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    So all of you suggesting table name with underscore instead of mixing uppercase and lowercase characters?
    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.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around

IMN logo majestic logo threadwatch logo seochat tools logo