Posts tonen met het label mysql. Alle posts tonen
Posts tonen met het label mysql. Alle posts tonen
2007-10-02
INSERT on duplicate key UPDATE
http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html
interessant
2007-08-28
Select binary characters
Beware, the BINARY option on fields and queries in MySQL does more than just discern case sensitivity. Not using it may give strange results:
SELECT BINARY 'e' = 'E';
0
SELECT 'e' = 'E';
1
SELECT BINARY 'e' = 'é';
0
SELECT 'e' = 'é';
1
This can give strange results if you have a CHAR field as part of a primary key. You collect data in a python dict, for example and want to store that data. Python will say your keys are unique, MySQL will give a duplicate entry error.
To prevent this from happening, there seem to be two options:
- No strange characters in your strings. Not easy.
- Use BINARY CHAR fields in keys. Easy, but has the case sensitive search side effect
Abonneren op:
Posts (Atom)
