[eluser]BizComputing[/eluser]
Highly sanitized code:
$this->db->select('field_3');
$this->db->where( array(
'field_1' => $my_obj->get_field('field_1'),
'field_2 <>' => $my_obj->get_field('field_2'),
'field_3' =>'value_3'
));
$result = $this->db->get('my_table');
$my_obj is a custom class with data, in this example, $my_obj->get_field('field_2') returns NULL which is a legit value.
here's the sanitized generated query:
SELECT `field_2` FROM (`my_table`) WHERE `field_1` = 'value_1' AND field_2 <> AND `field_3` = 'value_3'
As you can see, field_2 is generated without any value and therefore the query fails syntactically. I would have expected:
SELECT `field_2` FROM (`my_table`) WHERE `field_1` = 'value_1' AND field_2 <> NULL AND `field_3` = 'value_3'
As you can see by the generated query, I am using 1.6 refreshed from SVN yesterday afternoon. I am also noticing now that I am looking closer at the generated SQL that where keys that have both a field name and a condition are not getting backticked.
I am very happy with CI and extremely happy to see the current focus on a next version, keep up the great work!!!