Hi,
Ralph Schindler wrote:
> > $select->where('field2 = ?', 'foo', Zend_Db::PARAM_STR);
>
> This is not the type of values you are expected to provide here.
> $type, in this case, is expected to be one of these:
>
> Zend_Db::INT_TYPE, Zend_Db::BIGINT_TYPE, and Zend_Db::FLOAT_TYPE
>
> As mentioned here in the quote() documentation:
>
> http://framework.zend.com/manual/en/zend.db.adapter.html#zend.db.adapte
> r.quoting.quote
>
> The proper usage is more than likely not providing anything at all,
> after all it works as expected like that right? :) The default is to
> quote values.
OK. Before I start using Zend_Db, I wrote PDO statements.
In PDO statements you can specify the exact type (PDO::PARAM_*). I like
that. It isn't really needed in every DBMS but it has some nice side
effects. For example when you expect type X, but your query get a value from
type Y, an error is thrown. This will make your application harder to break
and helps to find logical problems. At least I think it is a good coding
style, if you specify everything you can.
When I saw Zend_Db::PARAM_* and that you can specify parameter types, I
thought it was the same like in PDO ;-)
But know I know, that this isn't supported and only needed for numeric
values. Thanks.
BTW: When or what uses Zend_Db::PARAM_* if you would use Zend_Db::*_INT for
numeric values?
> BTW, what DB platform are you using?
MySQL v5.0.x.
--
Regards,
Thomas