Closed (won't fix)
Project:
Drupal core
Version:
6.x-dev
Component:
documentation
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Dec 2010 at 15:19 UTC
Updated:
6 Oct 2019 at 16:10 UTC
Jump to comment: Most recent
Comments
Comment #1
jhodgdonOK, I agree that this could be clearer on the MySQL version of this function:
http://api.drupal.org/api/drupal/includes--database.mysql-common.inc/fun...
I'm not clear on whether the statement you are making is true for the PostgreSQL version though:
http://api.drupal.org/api/drupal/includes--database.pgsql.inc/function/d...
In any case, the next step would be to make a patch.
Comment #2
jhodgdonI am cleaning up old 6.x documentation issues. At this point, we are not spending effort fixing them. Sorry.
Comment #3
mattumd commentedI have done many works with db_last_insert_id and as far as I recall, I never had a case where I could or even wanted to get the ID of table. If by ID of table, you are referring to table name, I am sure it is not possible.
Another scenario that I run into was to get db_last_insert_id from a table whose connection and query was cross-database. So in those cases, you have to make sure to add database name in your query.
Another complex scenario is to use it in a chain of queries inside a MySQL transaction.
So even if PostgreSQL allows return of table ID, you have to be careful on how to use in cross-database queries since there is a chance two tables from two different databases have similar name or ID.
Thanks,
Matt
https://coding-bootcamps.com/
https://myhsts.org/
https://dcwebmakers.com/