EllisLab/CodeIgniter — Issue #941: Value between tags not correctly escaped?
Author: alex88
Created: 2012-01-19 09:24:59+00:00
State: open

Hi, i'm trying to insert some data in the db using active record insert

```php
$data = array(
'user' => $user,
'email' => $email,
'comment' => $comment,
'state' => $state,
'parent' => $parent_comment,
'ip' => $ip
);
if($this->db->insert('comments', $data)){
return $this->db->insert_id();
}else{
return false;
}
```

Variable $comment is test and the query returns a mysql error:

Error Number: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'strong, NULL, 0, '10.8.255.1')' at line 1
INSERT INTO `comments` (`user`, `email`, `comment`, `state`, `parent`, `ip`) VALUES ('test', 1, strong, NULL, 0, '10.8.255.1')

From docs:

Note: All values are escaped automatically producing safer queries.

So i was thinking that would be automatically escaped correct?