Re: Quote "draft"

From: Date: Fri, 13 Jul 2001 21:07:31 +0000
Subject: Re: Quote "draft"
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-727@lists.php.net to get a copy of this message
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
Placeholders really are intended only for column values, not things like table or column names or places like LIMIT where constants are required. You could just interpolate the limit value directly into the query string without using placeholders.
ex SELECT * FROM TAB WHERE id=? LIMIT ?,? would turn into SELECT * FROM TAB WHERE id='5' LIMIT '20', '5'
-- Paul DuBois, paul@snake.net

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