Page 1 of 1

table name 'case' issue between PHP4 & 5

Posted: Tue Jun 06, 2006 7:40 am
by mkaye
I have a production server on Linux running PHP4, MySQL 4.1.19
I have a development server on Unix running PHP5, MySQL 4.1.19
I am using a piece of code called MyActiveRecord.0.2 to build objects for each of my tables.
On PHP5 it works fine, but on PHP4 i get an error trying to access the table.
I tracked it down to a 'case' issue. My table name is 'Bug'. If i change it to 'bug' then it works on PHP4.
It is not practical to change all my table names on the development system.
I changed my Unix system to PHP4 and it behaves the same, so it seems to be a PHP issue & not an OS problem.
Is there a way to make it work with table names of mixed case with PHP4?

mark

Posted: Tue Jun 06, 2006 10:14 am
by bdlang
PHP doesn't care what the table name is, nor does it ever check case on any SQL statement; MySQL under Linux is case-sensitive, and under other operating systems it is not. You don't say what version of what Unix OS you're working with on your development server, but you should take a look at the operating system specific notes for more details.

For what it's worth, it's a Good Idea to have the same versions of the same OS/PHP/DBMS as your production server, so you don't have to go through the hassles of tweaking your code when sending to the production server. Trust me, I've been there. :P