Re: bind parameter for LIMIT statement
[prev]
[thread]
[next]
[Date index for 2005/01/26]
Perrin Harkins wrote:
> Julien GILLES wrote:
> > __PACKAGE__->add_constructor(lasts =3D> 'keywords like ? ORDER BY =
date
> > DESC LIMIT %s');
> >=20
> > =3D=3D> DBD::mysql::st execute failed: called with 2 bind variables =
when
1
> > are needed
> >=20
> > I misunderstood something...
>=20
> You have to actually pass a value for the %s when you call it. See
the=20
> Ima::DBI docs for an example.
>=20
I do pass a value, but the %s is not bound ,that's the problem. My
code is :
__PACKAGE__->add_constructor(lasts =3D> 'keywords like ? ORDER BY date
DESC LIMIT %s');
and the call :
My::Package->lasts("%foo%", 5);
--=20
Julien GILLES.
This email communication is confidential and is intended solely for whom =
it is addressed. Copying, or re-using in any way by anyone else is =
unauthorised. Any views or opinions expressed are those of the author =
and do not necessarily represent those of GL TRADE or any of its =
affiliates.=20
If you have received this mail in error, please destroy the copy in your =
possession and notify abuse@xxxxxxx.xxx