Reputation: 39303
Here is a MySQL query:
SELECT last_name FROM users ORDER BY last_name
We get all that data into PHP and then run:
$prior = NULL;
do {
$current = array_shift($results);
assert($current >= $prior);
$prior = $current;
} while ($current !== NULL);
Currently this assertion fails for certain inputs. Is it possible to add a COLLATE clause to the MySQL query above to absolutely guarantee that PHP assertion?
Stuff I tried:
ORDER BY email COLLATE utf8_bin
resulted in COLLATION 'utf8_bin' is not valid for CHARACTER SET 'latin1'
Others notes:
latin1
Upvotes: 0
Views: 1525
Reputation: 142453
echo ('a' == 'A') ? 'a==A ' : 'a <> A ';
echo ('a' == 'á') ? 'a==á ' : 'a <> á ';
Both came back <>
, so I deduce that PHP acts like latin1_bin
(or the _bin
of whatever charset you have).
Upvotes: 1