Hello. Have a look here: http://dev.mysql.com/doc/refman/5.0/en/mysql-real-escape-string.html
devy wrote: > Hi list, > > I'm having some problems while trying to save into a TEXT field some data > containing text and special characters from a C program! > I thought to convert the special characters with UTF8 but I don't know how > to write the SQL-query to insert data in the following table: > > CREATE TABLE `books` > ( > `id` int(11) NOT NULL auto_increment, > `txt` text character set latin1 NOT NULL, > PRIMARY KEY (`id`), > FULLTEXT KEY `txt` (`txt`) > ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC > > this because I should convert all characters to utf8 and I would convert > only the special one! For example I would like to do: > INSERT INTO books (txt) VALUES('exa \xC3\xAE mple'); > > but this will result in: "exa xC3xAE mple"! > > I know that I can do: > INSERT INTO books (txt) VALUES(concat('exa', convert(0xC3AE using utf8) > ,'mple')); > but I need a way to write this query without the use of concat (like the > first example) by converting special characters in a format understood by > mysql as UTF8 and preserving the others characters! > Is there a way? > > Thanks, > Devy > -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.NET http://www.ensita.net/ __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Gleb Paharenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.NET <___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]