Skip to content

Commit

Permalink
Merge pull request tombenner#154 from dangerousdan/fix-null-type-comp…
Browse files Browse the repository at this point in the history
…arison-issue

Fix null type comparison issue when saving data
  • Loading branch information
cyberscribe authored Aug 21, 2016
2 parents b6d52b7 + e556b59 commit f1cb5fd
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions core/models/mvc_database_adapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,13 @@ public function get_insert_columns_sql($data) {
public function get_insert_values_sql($data) {
$values = array();
foreach ($data as $value) {
if($value == null){
if ($value === null) {
$values[] = 'NULL';
}
else{
} elseif ($value === false) {
$values[] = 'FALSE';
} elseif ($value === true) {
$values[] = 'TRUE';
} else {
$values[] = '"'.$this->escape($value).'"';
}
}
Expand Down Expand Up @@ -238,4 +241,4 @@ public function delete_all($options) {

}

?>
?>

0 comments on commit f1cb5fd

Please sign in to comment.