MDB - insert query
| From: | Christian Karlsen | Date: | Fri, 07 Mar 2003 15:20:52 +0000 |
| Subject: | MDB - insert query | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-4089@lists.php.net to get a copy of this message | ||
Hello,
I'm using the latest stable version of MDB together with PostgreSQL 7.3.
I have a simple table like this:
users:
id (serial) # an integer (auto increment)
name (varchar (30))
the rest of the columns are irrelevant.
I prepare my query with prepareQuery(), adds the values into the prepared
query with setParamArray and execute it with executeQuery()
I want to return the inserted ID when my query is finish, how can I do
that?
I've consulted the documentation and it seems like executeQuery() can
return a result handle OR MDB_OK, but it's only returning MDB_OK, even if I
add an array of the types as an argument to executeQuery().
Since postgresql's auto increment function simply is a sequence, I guess I
just could use nextId() or currId() but that's not a desirable solution.
Anyone?
--
Greetings,
Christian Karlsen