pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Chris <dmagick@gmail.com>
To: F. <dev001@pas-world.com>
Cc: pgsql-php@postgresql.org
Subject: Re: PREPARE -> EXEC Problem
Date: Thu, 15 Jan 2009 15:40:48 +1100
Message-ID: <496EBE50.5010109@gmail.com> (raw)
In-Reply-To: <1231958385.11956.6.camel@localhost.localdomain>
References: <1231958385.11956.6.camel@localhost.localdomain>

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/




view thread (2+ messages)

Message-ID: <496EBE50.5010109@gmail.com>
Permalink:  ../496EBE50.5010109@gmail.com/
Also on:    postgresql.org/message-id/496EBE50.5010109@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: dmagick@gmail.com, dev001@pas-world.com
  Subject: Re: PREPARE -> EXEC Problem
  In-Reply-To: <496EBE50.5010109@gmail.com>
  References: <1231958385.11956.6.camel@localhost.localdomain> <496EBE50.5010109@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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