pg.ddx.io pgsql-php@postgresql.org mailing list archive
help / color / mirror / Atom feedPDO, postgre and PHP data types
3+ messages / 3 participants
[nested] [flat]
* PDO, postgre and PHP data types
@ 2009-05-25 19:08 Developer <dev002@pas-world.com>
0 siblings, 2 replies; 3+ messages in thread
From: Developer @ 2009-05-25 19:08 UTC (permalink / raw)
To: pgsql-php
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?
--
--
--
Publicidad y Servicios http://www.pas-world.com
Directorio http://www.precioventa.com
Tienda http://informatica.precioventa.com/es/
Autoridad certificadora http://ca.precioventa.com/es/
--
--
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: PDO, postgre and PHP data types
@ 2009-05-25 23:13 Chris <dmagick@gmail.com>
parent: Developer <dev002@pas-world.com>
1 sibling, 0 replies; 3+ messages in thread
From: Chris @ 2009-05-25 23:13 UTC (permalink / raw)
To: Developer <dev002@pas-world.com>; +Cc: 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/
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: PDO, postgre and PHP data types
@ 2009-05-26 11:57 Jasen Betts <jasen@xnet.co.nz>
parent: Developer <dev002@pas-world.com>
1 sibling, 0 replies; 3+ messages in thread
From: Jasen Betts @ 2009-05-26 11:57 UTC (permalink / raw)
To: pgsql-php
On 2009-05-25, Developer <dev002@pas-world.com> wrote:
> Hello,
> I have some problem with data type of PDO returned instance, array of
> integer (_int4[]) is returned as string.
yes.
> 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)?
php will never be "fast like c"
if you are not using the arrays with postgres stored procedures,
perhaps you could store them in a format that PHP is handles better
(eg: serialize)
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2009-05-26 11:57 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2009-05-25 19:08 PDO, postgre and PHP data types Developer <dev002@pas-world.com>
2009-05-25 23:13 ` Chris <dmagick@gmail.com>
2009-05-26 11:57 ` Jasen Betts <jasen@xnet.co.nz>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox