Just wanted to add that PHP has a GETLASTOID function that will work(after an insert) even if you don't use sequences/serials.
--Jean-Christophe Boggiocat(at)thefreecat(dot)orgIndependant Consultant and DeveloperDelphi, Linux, Perl, PostgreSQL