Problem with £ sign writing to MySQL (solved) |
I'm executing a script which reads a text file with fgetcsv and uses query builder insert to write records.
All goes well, except that any string which has a £ symbol is truncated at that position. The strings are are going into varchar, and phpMyAdmin lets me edit those characters in manually. The varchar columns are specified to be utf8_general_ci. Am I doing something wrong? Any assistance will be gratefully received! The controller does : if (($handle = fopen($f, "r")) !== FALSE) { while(($data = fgetcsv($handle,1000,"\t")) !== FALSE) { //file_put_contents('debug.txt',$data[2]."\r\n",FILE_APPEND); $this->maint_model->rec_entries($data,$id); } fclose($handle); } ...and the put_file_contents verifies the data was read OK. 'rec_entries' looks like this: public function rec_entries($data,$id) { $data = array( 'ind_id' => $id, 'name' => $data[0], 'subject' => $data[1], 'event' => $data[2], 'column' => $data[5], 'doi' => $data[4], 'page' => $data[3] ); $this->db->insert('entries', $data); // Make an entries table entry return; } |
Messages In This Thread |
Problem with £ sign writing to MySQL (solved) - by JohnInMaldon - 01-22-2016, 02:54 AM
RE: Problem with £ sign writing to MySQL - by JohnInMaldon - 01-27-2016, 06:03 PM
RE: Problem with £ sign writing to MySQL (solved) - by JohnInMaldon - 01-31-2016, 02:52 AM
|