Subject RE: RE: [firebird-php] auto increment last insert
Author Johan van Zyl
Hi
From a newbie - what do I put in $db and get_var?
$newcontactid = $db->get_var("SELECT GEN_ID(GEN_CONTACT,1) FROM
RDB\$DATABASE");

this is line 109
$userid = $host->userid("SELECT GEN_ID(G_USERS,1) FROM RDB$DATABASE");
echo 'UserID = '.$userid.'<br/>';
$sql = ibase_query("INSERT INTO users (userid, first_name, last_name,
email_address, username, \"PASSWORD\", info)
VALUES('$userid', '$first_name', '$last_name', '$email_address',
'$username', '$db_password', '$info2')") or die (ibase_errmsg());
Fatal error: Call to a member function on a non-object in
/home/e-smith/files/ibays/Primary/html/mc/register.php on line 109

And if you have a pre insert trigger calling the G_USERS?
-----Original Message-----
From: Alan McDonald [mailto:alan@...]
Sent: 24 November 2004 09:34
To: firebird-php@yahoogroups.com
Subject: RE: [firebird-php] auto increment last insert




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 Sponsor
ADVERTISEMENT





----------------------------------------------------------------------------
--
Yahoo! Groups Links

a.. To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-php/

b.. To unsubscribe from this group, send an email to:
firebird-php-unsubscribe@yahoogroups.com

c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


---
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


[Non-text portions of this message have been removed]