[eluser]ururk[/eluser]
I've found that in a few instances AR doesn't properly detect the type of value, and doesn't put ticks around a string - as an example, importing XML into a DB record (simplexml_load_string), I loop through the loaded XML:
$title = $xml->title;
when inserting, $title, AR didn't put single-quotes around the string, and the query was invalid.
This worked:
$title = (string) $xml->title;
YMMV, could have been my server.