You can do
$data = array( 'designationName' => preg_replace('/[^a-zA-Z0-9-_\.]/','', $row[$ex_start + 3]) 'designationDate' => date('Ym-d'), 'status_idstatus' => '1' );
Note. . This will save plain text + numbers. No, any special characters will pass
Change 01
If you need to allow some special characters (all keyboard characters)
preg_replace('/[^A-Za-z0-9_~`\/@!$.%^#&*\\()+-=]/','', $row[$ex_start + 3])
Or you can use query execution in codeigniter
$this->db->escape()$this->db->escape_str()$this->db->escape_like_str()
source share