Is that possible to write a general function that does the equivalent function of mysql_last_insert_id? If database provider changes, users can still use that function.
Also, it's better to have a mysql_free_result too.
Is that possible to write a general function that does the equivalent function of mysql_last_insert_id? If database provider changes, users can still use that function.
Also, it's better to have a mysql_free_result too.
Comments
Comment #1
drummAPI changes and features will not happen in the 5.x branch, which is stable. Some of this functionality has been added to 6.x. If more is needed, please reopen with detailed and specific requests. Further changes will happen in 7.x at earliest.
Comment #2
Crell commentedDBTNG already has this.
Comment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #4
Andrey Zakharov commentedThere is no (mysql|mysqli)_free_result at all in DB layer of drupal 6. ( Am I wrong? point me )
In the API docs for Drupal 7 I can't see also this.
Bad.
Comment #5
Andrey Zakharov commentedComment #6
Crell commentedIf an insert query generates a new autoincrement value, that value will be returned by InsertQuery::execute().
You almost never need to free an SQL result set yourself, as it will be freed automatically as soon as the variable goes out of scope. If you really do want to free the result set for some reason, then in D7 you can just unset($result).
Please do not reopen issues that have been auto-closed.