diff --git a/src/CoreFields/DoubleField.php b/src/CoreFields/DoubleField.php index 2cfc4e8..c93925a 100644 --- a/src/CoreFields/DoubleField.php +++ b/src/CoreFields/DoubleField.php @@ -14,8 +14,8 @@ class DoubleField extends PhangoField { public $label=""; public $required=0; public $form=""; - public $quot_open='\''; - public $quot_close='\''; + public $quot_open=''; + public $quot_close=''; public $std_error=''; function __construct($size=11) diff --git a/src/CoreFields/IntegerField.php b/src/CoreFields/IntegerField.php index 02ae386..a8e8ceb 100644 --- a/src/CoreFields/IntegerField.php +++ b/src/CoreFields/IntegerField.php @@ -27,6 +27,8 @@ class IntegerField extends PhangoField { $this->only_positive=$only_positive; $this->min_num=$min_num; $this->max_num=$max_num; + $this->quot_open=''; + $this->quot_close=''; } @@ -95,4 +97,4 @@ class IntegerField extends PhangoField { } -?> \ No newline at end of file +?> diff --git a/src/Webmodel.php b/src/Webmodel.php index 0cceafd..5d1deec 100644 --- a/src/Webmodel.php +++ b/src/Webmodel.php @@ -732,8 +732,16 @@ class Webmodel { foreach($args as $key => $arg) { + $quot='"'; - $arr_conditions[$key]=$arr_conditions[$key].'"'.$this->escape_string($arg).'"'; + if(gettype($arg)==='integer' || gettype($arg)==='float') + { + + $quot=''; + + } + + $arr_conditions[$key]=trim($arr_conditions[$key].$quot.$this->escape_string($arg).$quot); } @@ -893,7 +901,7 @@ class Webmodel { $this->std_error.=I18n::lang('error_model', 'cant_insert', 'Can\'t insert').' '; ModelForm::pass_errors_to_form($this); - return 0; + return false; } else @@ -906,7 +914,7 @@ class Webmodel { } - return 1; + return true; } } @@ -923,7 +931,7 @@ class Webmodel { ModelForm::pass_errors_to_form($this); $this->std_error.=I18n::lang('error_model', 'cant_insert', "Can't insert").' '; - return 0; + return false; }