My Sql Table Names and Case-Sensitivity

9 June, 2009

My Sql Table Names and Case-Sensitivity

While implementing the generate quote page for the Learning Gateway Conference I was storing the quote details in a My Sql database. Normally I use Sql Server, but that’s an optional extra on my hosting plan, so I went for MySql which is included, thinking how different can it be. I’d already got had some experience of working with it while integrating with Moodle (no longer available).

So I had everything up an running nicely on my development server, until I uploaded the code to the live server, then suddenly, bang, the database calls stopped working with the exceptions talking about an invalid query. I finally tracked it down to the case-sensitivity of the table names in MySql. In windows, the table names are case-insensitive, while on Linux the table names are case-sensitive, and my ISP hosts the MySql databases on Linux machines.

The most annoying thing is that I’m normally very careful about case-sensitivity, but didn’t pay attention to it in this specific case. Moral of the story is always be case-sensitive when coding even if you don’t have to be.

Richard Willis

Written by

Copyright © 2024 SalamanderSoft Limited