php - Force greaterThan with numbers in Zend Mysql -
php - Force greaterThan with numbers in Zend Mysql -
i'm using next code:
$age=10; //user input $select ->columns(["id"=>"id"]) ->where->greaterthan("age",$age); echo $select->getsqlstring();
this gives me folowing result:
select "program"."id" "id" "program" "age" > '10'
however, utilize >
ints, eg have resulting query
select "program"."id" "id" "program" "age" > 10
how can accomplish using greaterthan
predicate?
i know can write ->where("age > $age");
that's not secure nor beautiful.
looking @ the documentation, greaterthan
has function header:
public function greaterthan($left, $right, $lefttype = self::type_identifier, $righttype = self::type_value);
though not documented, setting $righttype
type of predicate::type_literal
might expose literal integer value. not know whether type_literal
values still beingness escaped properly. please verify.
php mysql zend-framework zend-framework2
Comments
Post a Comment