Re: [PDO] Mapping data type/size
[email protected] (Lukas Kahwe Smith) Thu, 29 Oct 2009 19:05:49 +0100
| Newsgroups | php.pdo |
|---|---|
| Message-ID | <[email protected]> |
On 29.10.2009, at 17:59, goran miskovic wrote: > I am using PDO:: PARAM_BOOL although in mySQL it would be 0 or 1 and > it > makes sense to me: Boolean is variable type defined in PHP and as a > developer I don't care much if there is matching field type in the > database > or not. For sure somehow it must be handled. I would expect PDO to > know in > which way particular database is handling boolean values and send > correct > value. > > My understanding is that when explicitly defining variable type I am > saying > that given variable is of defined PHP type and it is on PDO to handle > it accordingly to RDBMS in use. well the problem is that there is no defined way to handle bools in mysql. i think they made it an alias tinyint (added in 4.1): http://dev.mysql.com/doc/refman/4.1/en/numeric-type-overview.html but there are still plenty of people that use char(1). regards, Lukas Kahwe Smith [email protected]