Re: [PDO] Mapping data type/size

From: Date: Thu, 29 Oct 2009 18:05:49 +0000
Subject: Re: [PDO] Mapping data type/size
References: 1 2 3 4 5 6  Groups: php.pdo 
Request: Send a blank email to pdo+get-253@lists.php.net to get a copy of this message
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 mls@pooteeweet.org

« previous php.pdo (#253) next »