Thanks for the help I received. I did run different queries like $number = pg_Exec ($db_connect, "SELECT nextval('members_recordid_seq')"); $number = pg_Exec ($db_connect, "SELECT last_value FROM members_recordid_seq"); What I get when I "echo $number;" is "Resource id #2", no matter what number the sequence is at (currently 19). If I run the same queries in phpPgAdmin I get the correct results. I run PHP 4.04 and PgSQL 7.03 Any ideas? __________________________________________________ Do You Yahoo!? Make a great connection at Yahoo! Personals. http://personals.yahoo.com