Subject | RE: RE: [firebird-php] auto increment last insert |
---|---|
Author | Johan van Zyl |
Post date | 2004-11-24T09:04:10Z |
So then this was supposed to work? But it does not. It complains about NULL
userid
$userid=ibase_query('SELECT GEN_ID(G_USERS, 1) from rdb$database');
-----Original Message-----
From: agung wibowo [mailto:ag3x@...]
Sent: 24 November 2004 10:20
To: firebird-php@yahoogroups.com
Subject: RE: [firebird-php] auto increment last insert
this is work in isql:
"select gen_id(gen_data_id,0) from RDB$DATABASE;"
the result is gen_id column with last value inserted,
but i don't know about PHP, maybe it's work to..
Alan McDonald <alan@...> wrote:
Hi
I believe that Firefox uses gen_id to trigger a generator to be used
for auto incrementing values. Mysql on PHP has an easy way
(mysql_insert_id) in determining the last inserted id. Do we have a
corresponding feature like this for firebird?
Thanks.
Arnold
[Alan McDonald] Firefox os the browser, Firebird is the RDBMS
This is how I get a new value
$newcontactid = $db->get_var("SELECT GEN_ID(GEN_CONTACT,1) FROM
RDB\$DATABASE");
Then you use it to insert your new record
Alan
[Non-text portions of this message have been removed]
Yahoo! Groups SponsorADVERTISEMENT
---------------------------------
Yahoo! Groups Links
To visit your group on the web, go to:
####***groups.yahoo.com/group/firebird-php/
To unsubscribe from this group, send an email to:
firebird-php-unsubscribe@yahoogroups.com
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
---------------------------------
Do you Yahoo!?
Meet the all-new My Yahoo! Try it today!
[Non-text portions of this message have been removed]
Yahoo! Groups Links
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (####***www.grisoft.com).
Version: 6.0.799 / Virus Database: 543 - Release Date: 2004/11/19
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.799 / Virus Database: 543 - Release Date: 2004/11/19
userid
$userid=ibase_query('SELECT GEN_ID(G_USERS, 1) from rdb$database');
-----Original Message-----
From: agung wibowo [mailto:ag3x@...]
Sent: 24 November 2004 10:20
To: firebird-php@yahoogroups.com
Subject: RE: [firebird-php] auto increment last insert
this is work in isql:
"select gen_id(gen_data_id,0) from RDB$DATABASE;"
the result is gen_id column with last value inserted,
but i don't know about PHP, maybe it's work to..
Alan McDonald <alan@...> wrote:
Hi
I believe that Firefox uses gen_id to trigger a generator to be used
for auto incrementing values. Mysql on PHP has an easy way
(mysql_insert_id) in determining the last inserted id. Do we have a
corresponding feature like this for firebird?
Thanks.
Arnold
[Alan McDonald] Firefox os the browser, Firebird is the RDBMS
This is how I get a new value
$newcontactid = $db->get_var("SELECT GEN_ID(GEN_CONTACT,1) FROM
RDB\$DATABASE");
Then you use it to insert your new record
Alan
[Non-text portions of this message have been removed]
Yahoo! Groups SponsorADVERTISEMENT
---------------------------------
Yahoo! Groups Links
To visit your group on the web, go to:
####***groups.yahoo.com/group/firebird-php/
To unsubscribe from this group, send an email to:
firebird-php-unsubscribe@yahoogroups.com
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
---------------------------------
Do you Yahoo!?
Meet the all-new My Yahoo! Try it today!
[Non-text portions of this message have been removed]
Yahoo! Groups Links
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (####***www.grisoft.com).
Version: 6.0.799 / Virus Database: 543 - Release Date: 2004/11/19
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.799 / Virus Database: 543 - Release Date: 2004/11/19