In oracle it is rowid but it is a thing with some oddities that are not publically known. If you resequence or if you delete rows then the rowid can become and old rowid that once existed. Tho rowid is unique it is not uique over all the historical rowid’s.
If you want a unique number you are better of using triggers. This generally workd on all databases. But you have to write each trigger yourself for each database.
http://www.firebirdsql.org/manual/migration-mssql-data-types.html
http://www.postgresql.org/docs/9.1/static/sql-createtrigger.html
etc… most databases do have triggers and with those you can make an independant mechanism specially when you use an extra table with a last-id per per table.
e.g. a table with (in oracle terms):
tbl varchar(128),
lastid number <----start with 1 and just do an update on this value via the trigger mechanism.
Using a after or before insert trigger (provided the database supports it) you can make it rather independant.
The disadvantage is that once you have saved the record that you need to get the id again using a select and if you put it in your webform field you need to update that field immediately after the insert. I foresee some problems but I think they are solveable.
An alternative is:
Since you are working in php you could of course also use a combination of md5(uniqid(‘myapp’,true)) or even if you insist md5(uniqid(‘mytable’,true)) and just set counter id to that
string. Inserting would be easy then, and updating is never needed.
Since it is in php your id would work on all databases.
How about that attempt?