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

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -