Welcome Guest, Not a member yet? Register   Sign In
Save pound symbol to database
#1

[eluser]kirk112[/eluser]
Hi,

I'm new to codeIgniter so please bear with me,

I am using the following code to save data collected from a form into a MySQL database.

Code:
$query = $this->db->query("INSERT INTO competition_answers (competition_id, question_id, user_id, answer) VALUES (".$this->db->escape($competition_id).", ".$this->db->escape($value).", ".$this->db->escape($user_id).", ".$this->db->escape($answer).") ");

which produces the following query

Code:
INSERT INTO competition_answers (competition_id, question_id, user_id, answer) VALUES (1, '3', '27', 'test with £')

and work apart from the £ symbol not being inserted into the table.

I have set the encoding to UTF8 and the database collation is set to the same. If I run the above query directly in phpMyAdmin the query run correctly and the £ symbol is insert correctly.

I am able to save other symbol such as !"$%^&* fine just the £ is missing.

Not sure where to start debugging?

Any suggestions?

Thanks for your help!!!


Messages In This Thread
Save pound symbol to database - by El Forum - 01-28-2010, 10:31 AM
Save pound symbol to database - by El Forum - 01-28-2010, 04:06 PM
Save pound symbol to database - by El Forum - 01-29-2010, 12:22 AM
Save pound symbol to database - by El Forum - 01-29-2010, 12:25 AM
Save pound symbol to database - by El Forum - 01-29-2010, 12:29 AM
Save pound symbol to database - by El Forum - 01-29-2010, 01:20 AM
Save pound symbol to database - by El Forum - 01-29-2010, 01:32 AM
Save pound symbol to database - by El Forum - 01-29-2010, 01:33 AM
Save pound symbol to database - by El Forum - 01-29-2010, 01:49 AM
Save pound symbol to database - by El Forum - 01-29-2010, 01:59 AM
Save pound symbol to database - by El Forum - 01-29-2010, 03:21 AM
Save pound symbol to database - by El Forum - 01-29-2010, 03:28 AM
Save pound symbol to database - by El Forum - 01-29-2010, 04:48 AM
Save pound symbol to database - by El Forum - 01-29-2010, 05:02 AM



Theme © iAndrew 2016 - Forum software by © MyBB