PREPARE -> EXEC Problem

Lists: pgsql-php
From: "F(dot)" <dev001(at)pas-world(dot)com>
To: pgsql-php(at)postgresql(dot)org
Subject: PREPARE -> EXEC Problem
Date: 2009-01-14 18:39:45
Message-ID: 1231958385.11956.6.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-php

Hello,
I'm trying to execute a query with a DEFAULT value for primary key value
but do not work.
pdo->prepare("INSERT INTO "Table" ("id","colum") VALUES(?,?)");
$arr=('DEFAULT','helloworld');
Result of PDO is "not valid value for integer".
Anyone know, How assign DEFAULT value in pdo->exec($arr)?


From: Chris <dmagick(at)gmail(dot)com>
To: "F(dot)" <dev001(at)pas-world(dot)com>
Cc: pgsql-php(at)postgresql(dot)org
Subject: Re: PREPARE -> EXEC Problem
Date: 2009-01-15 04:40:48
Message-ID: 496EBE50.5010109@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: Postg토토SQL : Postg토토SQL 메일 링리스트 : 2009-01-15 이후 PGSQL-PHP 04:40

F. wrote:
> Hello,
> I'm trying to execute a query with a DEFAULT value for primary key value
> but do not work.
> pdo->prepare("INSERT INTO "Table" ("id","colum") VALUES(?,?)");
> $arr=('DEFAULT','helloworld');
> Result of PDO is "not valid value for integer".
> Anyone know, How assign DEFAULT value in pdo->exec($arr)?

I would have guessed there'd be a constant defined for it
(http://au2.php.net/manual/en/pdo.constants.php) but can't see anything.

Can you not include the column in the query? then the db will
automatically use the default value.

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