I am working with codeigniter / SQL. Where I want to insert unicode string with 'N' Prefix the insert. How can I achieve it in regular insert.
Regular Code:
$data = array(
'title' => 'My title' ,
'name' => 'My Name' ,
'data' => 'My data'
);
$this->db->insert('mytable', $data);
INSERT Trying to Achieve:
INSERT INTO mytable (title, name, data)
VALUES ('My title','My Name',N'My data');
Is there any way to achive the above insert instead of manually writing the Query.?
_insert()method and make your own that checks every value and use it as converted to N prefix where needed. Check lines 1396 - 1399.Nbefore your input string isn't actually what you are doing in your project, but we need to better understand your intent. Are you trying to add a prefix to the string value or are you trying to add a SQL-specific function call before the value? We don't know and can only assume.