table name 'case' issue between PHP4 & 5

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

Moderator: General Moderators

Post Reply
mkaye
Forum Newbie
Posts: 8
Joined: Sat Oct 29, 2005 9:40 am

table name 'case' issue between PHP4 & 5

Post 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
bdlang
Forum Contributor
Posts: 395
Joined: Tue May 16, 2006 8:46 pm
Location: Ventura, CA US

Post 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
Post Reply