Re: [PDO] Mapping data type/size
| From: | Lukas Kahwe Smith | Date: | Thu, 29 Oct 2009 14:30:36 +0000 |
| Subject: | Re: [PDO] Mapping data type/size | ||
| References: | 1 2 | Groups: | php.pdo |
| Request: | Send a blank email to pdo+get-249@lists.php.net to get a copy of this message | ||
On 28.10.2009, at 19:41, Lukas Kahwe Smith wrote:
On 28.10.2009, at 18:15, Lester Caine wrote:oh just learned there is a PDO::PARAM_BOOL http://php.net/manual/en/pdo.constants.php regards, Lukas Kahwe Smith mls@pooteeweet.orgPlease bare with me ... I'm still trying to 'convert' from my normal way of working ;) PDO::PARAM_INT is available, but no other numeric formats? I've been working through all the options to map data types into the correct internal format, but I'm not having much luck. Numeric types would be better passed as numbers rather than strings, but the main problem I'm hitting here is how to know which field types from one database map to another. Such as 'BOOL' which is normally handled as a CHAR(1) in Firebird, and also the different numeric field sizes of FLOAT and the like. The bottom line is that we have to know the structure of the table before we can use it? We can't simply ask for those details from the database and adjust things acordingly?Well bool is one of those examples that is hard to do, since many developers do it differently and most RDBMS do not support it natively. So some do BIT, others TINYINT, yet others CHAR(1) and some have a native type.