Welcome Guest, Not a member yet? Register   Sign In
Insert French Character to Table
#1

[eluser]Unknown[/eluser]
Hi,

I have a simple table, it uses "latin1_swedish_ci" collation.
When i insert it from a simple PHP script without Code Igniter to the same table, the french characters are inserted 100% correctly.

But when i execute the query from Code Igniter to the same table, french chars are replaced with question mark.

Here is my CI code.
Code:
$str = mt_rand(1, 100000).' Digsby est un client multiprotocole de messagerie instantanée qui vous permet de parler avec tous vos amis sur AIM, MSN, Yahoo, ICQ, Google Talk et Jabber avec une liste de contacts simple à gérer.';

$this->db->simple_query("SET NAMES UTF8");

$q2 = "UPDATE `test` SET `something` = '$str' WHERE `the_id` = 2 LIMIT 1";
var_dump($q2);
$this->db->query($q2);

Even when i var_dump() the query, the query is normal (french chars are not replaced). But on phpmyadmin, it is not inserted correctly.

Here are the french characters

Digsby est un client multiprotocole de messagerie instantanée qui vous permet de parler avec tous vos amis sur AIM, MSN, Yahoo, ICQ, Google Talk et Jabber avec une liste de contacts simple à gérer.


Messages In This Thread
Insert French Character to Table - by El Forum - 11-08-2010, 11:36 PM
Insert French Character to Table - by El Forum - 11-08-2010, 11:41 PM
Insert French Character to Table - by El Forum - 11-09-2010, 12:01 AM
Insert French Character to Table - by El Forum - 12-03-2010, 07:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB