Welcome Guest, Not a member yet? Register   Sign In
DB Active Record - addslashes on data?
#1

[eluser]gscharlemann[/eluser]
Hello

Quick question. Is there a simple way to escape the data being inserted via the active record class? Here's the scenario: I have an array of keys and values that is parsed from a CSV file. One of the values is a name field, which inevitably contained a name like: "O'keefe"
Code:
$this->db->insert('mytable', $data);
throws an error on O'keefe, because of the '. How can I run the addslashes() function on all of the values in the $data array? The $data array contains between 300 and 1500 key, value pairs, usually.

Thanks!


Messages In This Thread
DB Active Record - addslashes on data? - by El Forum - 11-04-2009, 12:23 PM
DB Active Record - addslashes on data? - by El Forum - 11-04-2009, 03:10 PM
DB Active Record - addslashes on data? - by El Forum - 11-04-2009, 03:14 PM
DB Active Record - addslashes on data? - by El Forum - 11-04-2009, 03:30 PM
DB Active Record - addslashes on data? - by El Forum - 11-04-2009, 06:52 PM
DB Active Record - addslashes on data? - by El Forum - 11-10-2009, 06:41 AM



Theme © iAndrew 2016 - Forum software by © MyBB