Re: metapear datatypes
| From: | John Lim | Date: | Thu, 21 Mar 2002 15:33:24 +0000 |
| Subject: | Re: metapear datatypes | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-5069@lists.php.net to get a copy of this message | ||
Hi Tomas,
If the database API is not good enough to reveal the type info required,
I use a simple heuristic:
if (! is_numeric($val)) $conn->qstr($val);
eg. I only quote non-numeric variables. This normally works with dates
because most databases accept dates as strings fortunately.
Regards, John
----
Tomas V.V.Cox <cox@idecnet.com> wrote in message
news:1016649797.14617.111.camel@router.vulcanonet.com...
El mié, 20-03-2002 a las 19:21, Stig S. Bakken escribió:
> On Wed, 2002-03-20 at 18:00, Lukas Smith wrote:
I put some ideas on how to handle datatypes with placeholders in a more
easy way at php4/pear/DB/IDEAS. I guess is not possible to be able to
automatically do this stuff at least in prepare/exec. What perhaps could
be done is when you get the data back from a fetch action (doing
something like tableinfo($res) does) but it won't work in other backend
different than MySQL. In short, datatypes will be a manual thing that
should be though to be as easy as we can.
John, how do you do it for ADODB?
Tomas V.V.Cox