Skip site navigation (1) Skip section navigation (2)

Re: PDO, postgre and PHP data types

From: Chris <dmagick(at)gmail(dot)com>
To: Developer <dev002(at)pas-world(dot)com>
Cc: pgsql-php(at)postgresql(dot)org
Subject: Re: PDO, postgre and PHP data types
Date: 2009-05-25 23:13:47
Message-ID: 4A1B262B.60301@gmail.com (view raw or flat)
Thread:
Lists: pgsql-php
Developer wrote:
> Hello,
> I have some problem with data type of PDO returned instance, array of
> integer (_int4[]) is returned as string.
> 
> I read ref.pgsql.php, but nothing said how solve this problem.
> 
> I use something like this for it:
> $dat=array($k=>explode(',',trim($v,'{}'))); // One dimension array
> But it is very slow. Any method to return correct data types from
> DATABASE to PHP parsed with high speed code (like C)?
> Any postgresql driver version?

PDO will only know basic data types (strings, int, possibly bool) and an 
int array is not a basic type. It's also designed to be 'database 
independent' so this won't be included at all most likely.

If you want it in C, you'll have to put it together yourself but I doubt 
it'd ever be included in php core (but you can always try).

-- 
Postgresql & php tutorials
http://www.designmagick.com/


In response to

pgsql-php by date

Next:From: Jasen BettsDate: 2009-05-26 11:57:40
Subject: Re: PDO, postgre and PHP data types
Previous:From: DeveloperDate: 2009-05-25 19:08:57
Subject: PDO, postgre and PHP data types

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group