Nette\Database\Table\Selection where() probably ingnors case-sensitive

Notice: This thread is very old.
AntiCZ
Member | 11
+
0
-

Hello, I have a little problem with whare() in Nette\Database\Table\Selection

		$packageCode = 'GImpq';

$packageData = $this->database->table('packages')->select('*')->where('package_code=?',$packageCode)->fetch();

print_r($packageData->package_code); //'GImpQ';

Is problem on my side or Nette side?

Thank you for help.


Nette 2.2.2

Table utf8_unicode_ci – innoDB

Table row – Varchar(5) utf8_unicode_ci

s4muel
Member | 92
+
+1
-

set the column collation to ‘utf8_bin’ or try

$packageData = $this->database->table('packages')->select('*')->where('BINARY package_code = ?', $packageCode)->fetch(); //not guaranteed, just give it a shot.

more reading: http://stackoverflow.com/…son-on-mysql

Last edited by s4muel (2014-11-12 14:50)

AntiCZ
Member | 11
+
0
-

Ohh, thank you.

utf8_bin helped and BINARY is not required (in my case).