1

If I print_r($object) I get:

Array ( [id] => 1 [ime] => rwe [letnica] => 0 [mesec] => 1 [datoteka] => [disciplineid] => 2 [rangtekmovanjaid] => 3 )

My DB columns are:

- disciplineId
- rangtekmovanjaId

I set lower_case_table_names=0 in my.ini for mysql 5.0 part of xampp but is the same. What is wrong?

2 Answers 2

11

To fix this on XAMPP go to your my.ini file (e.g. inside C:\xampp\mysql\bin) and find the [mysqld] area.

Add to it the following line:

lower_case_table_names=0

restart your apache & mysql

now your table names are case sensitive even on a windows system.

Sign up to request clarification or add additional context in comments.

Comments

1

According to MySQL manual

You should NOT set this variable to 0 if you are running MySQL on a system that has case-insensitive file names (such as Windows or Mac OS X). If you set this variable to 0 on such a system and access MyISAM tablenames using different lettercases, index corruption may result. On Windows the default value is 1. On Mac OS X, the default value is 2.

MySQL: Identifier Case Sensitivity

In MySQL, databases correspond to directories within the data directory. Each table within a database corresponds to at least one file within the database directory (and possibly more, depending on the storage engine). Consequently, the case sensitivity of the underlying operating system plays a part in the case sensitivity of database and table names. This means database and table names are not case sensitive in Windows, and case sensitive in most varieties of Unix. One notable exception is Mac OS X, which is Unix-based but uses a default file system type (HFS+) that is not case sensitive.

more

By default, table aliases are case sensitive on Unix, but not so on Windows or Mac OS X.

That means, on Linux servers (Unix) table/column name "Test" is not equal with "test", "TEST", "tESt", etc. by default.

2 Comments

but if i move page from win to linux then everything stop working becouse column name is "rangtekmovanjaId" and in php i must use "rangtekmovanjaId" not "rangtekmovanjaid" like in windows. So how can i make in windows "rangtekmovanjaId" filed in mysql itentical to "rangtekmovanjaId" in php and not like "rangtekmovanjaid"
@senzacionale - No, it's not PHP... MySQL causes problems. Above, in first quotation you'll find If you set this variable to 0 on such a system and access MyISAM tablenames using different lettercases, index corruption may result., I don't know any other solution then to rewrite all your table names to lowercase extension. I've faced similar problem year ago and since than, I'm using lowercase only for everything in PHP and MySQL.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.