diff --git a/Westdc/Db/Dbh.php b/Westdc/Db/Dbh.php index b518729..431a381 100644 --- a/Westdc/Db/Dbh.php +++ b/Westdc/Db/Dbh.php @@ -2,6 +2,7 @@ namespace Westdc\Db; use Westdc\Helpers\Assist as view; +use Westdc\Helpers\Assist; class Dbh { @@ -81,7 +82,7 @@ class Dbh foreach($data as $k=>$v) { - if(is_int($v) || is_float($v) || is_bool($v)) + if(is_int($v) || is_float($v) || is_bool($v) || $v === "NULL") { $ups[] = '"'.$k.'"='.$v; }else{ @@ -122,6 +123,7 @@ class Dbh } }else{ $sql = "UPDATE \"".$table."\" SET $fields $wheresql RETURNING id"; + //exit($sql); try{ $sth = $this->db->prepare($sql); if($sth->execute()) @@ -136,7 +138,7 @@ class Dbh { return false; }else{ - echo view::Dump('Caught exception: '. $e->getMessage(). "\n"."SQL:".$sql,false); + echo Assist::Dump('Caught exception: '. $e->getMessage(). "\n"."SQL:".$sql,false); } } }