Functions
WebDev/*nix assorted functions & hacks
Search
find all
Array
-
Bash
-
Classes
-
Config
-
DateTime
-
Debug
-
dotjs
-
File
-
foooo
-
Git
-
HTML
-
Images
-
Javascript
-
Linux
-
Math
-
Misc
-
MySQL
-
OS X
-
Reading
-
Redis
-
Shell scripts
-
snippets
-
SQL
-
Strings
-
TextMate
-
Web
-
\(^o^)/ Fun!
-
_Misc hacks
-
_Pages
MySQL
fetch_field(), fetch_row(), fetch_rows(), mres()
query($sql)
Unicode
Unicode configuration
You forgot your MySQL root password AGAIN
5
found
auth
Name:
Category: MySQL
Body:
This topic requires a website on its own, really, but .. here's a page. From Lite™®© SQL administration notes: ------------------------------------------------------------------- Now, when the HTTP headers are utf8, and the data is utf8, and you have a utf8 metatag characterset (which is overruled by the HTTP header anyway..), make sure the database, tables and fields are also utf8. Then, make sure the connection is utf8, and the client character set is utf8. Also, the result character set should be utf8. Those last 3 you can do in one go with: SET NAMES utf8 Do this as first query (like, right after mysql_connect()). To check what, currently, is and is not utf8, these should give you some idea: SHOW variables WHERE variable_name LIKE '%coll%' OR variable_name LIKE '%char%' SHOW CREATE TABLE `tableName` With the latter pay attention to DEFAULT CHARSET=utf8 in the last line, and any mention of character related things after the column definition lines. Also note: even if you can see the proper Arabic glyphs (or whatever you stored) in the command-line client via a proper modern terminal emulator, that does not mean the table or field character sets are utf8. To change the character set of a single column, use ALTER TABLE `tableName` MODIFY `colName` varchar(12) CHARACTER SET utf8 To change the default character set of a table: ALTER TABLE `tableName` CHARACTER SET utf8 To change the default character set of a table and all its columns (this does NOT convert the *data* in those columns!): ALTER TABLE `tableName` CONVERT TO CHARACTER SET utf8 ------------------------------------------------------------------- See also: http://mech.cx/tools/functions.php?q=misc+mysql+stuffs http://mech.cx/tools/functions.php?q=utf8 Online: http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci http://blog.makezine.com/archive/2007/05/mysql-database-migration-latin.html
Footer