Skip to content
Home » News

News

Converting MySQL tables to UTF-8

Quick and easy code to convert the character set of a MySQL table to UTF-8. Of course this works for all character sets not just UTF ALTER TABLE tbl_name CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;

MySQL REPLACE Function

Just a quick reminder and example to myself really for this useful MySQL string function. Syntax: REPLACE( table_field, search, replace) Example (replaces all instances of donkey with horse: UPDATE `table` SET `table_field` = REPLACE( `table_field`, ‘donkey’, ‘horse’)