Subject | Re: [firebird-php] auto increment last insert |
---|---|
Author | Milan Babuskov |
Post date | 2004-11-25T05:09:49Z |
Nigel Weeks wrote:
$gensql = 'SELECT GEN_ID(gen_tbl_test,1) AS NEW_ID from rdb$database';
--
Milan Babuskov
http://fbexport.sourceforge.net
http://www.flamerobin.org
> // in php4, run a query to get the next value of the generatorOr just simply use the single-quotes:
> $gensql = "SELECT GEN_ID(gen_tbl_test,1) AS NEW_ID from rdb\$database";
> /* Notes:
> * I renamed the result as NEW_ID so it's easier to see amongst the rest of
> the code
> * Also, remember to escape the $ in the rdb/$database - otherwise PHP will
> think it's a variable
> */
$gensql = 'SELECT GEN_ID(gen_tbl_test,1) AS NEW_ID from rdb$database';
> If you remove all the comments, it's about 6 lines of code.Yep, nice clean and concise.
--
Milan Babuskov
http://fbexport.sourceforge.net
http://www.flamerobin.org