Re: Re: Quote "draft"

From: Date: Sat, 14 Jul 2001 07:41:56 +0000
Subject: Re: Re: Quote "draft"
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-737@lists.php.net to get a copy of this message
yavor wrote: > > I had a problem with prepare/execute when passing offset/limit to mysql it > was trying to quote the integers which mysql didn't like. I had to patch it > not to add quotes if the value was an integer, while a performace hit it > might be a good idea to do type checking and quote only selective data > types. This was a while ago maybe it's fixed but anyhow > > ex > > SELECT * > FROM TAB > WHERE id=? > LIMIT ?,? > > would turn into > > SELECT * > FROM TAB > WHERE id='5' > LIMIT '20', '5' > Here you have two options: 1) Use the new placeholder "!" in LIMIT. SELECT * FROM TAB WHERE id=? LIMIT !,! 2) Send the patch you made to the list to be included :) (I'm doing something similar for the PostgreSQL extension). Tomas V.V.Cox

« previous php.pear.dev (#737) next »