Request for some usefule functions of database abstruction layer

andyhu - November 23, 2007 - 08:18
Project:Drupal
Version:7.x-dev
Component:database system
Category:feature request
Priority:normal
Assigned:andyhu
Status:closed
Description

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.

#1

drumm - November 26, 2007 - 06:49
Version:5.3» 7.x-dev
Priority:critical» normal
Status:active» postponed (maintainer needs more info)

API 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.

#2

Crell - October 6, 2008 - 01:31
Status:postponed (maintainer needs more info)» fixed

DBTNG already has this.

#3

Anonymous (not verified) - October 20, 2008 - 01:32
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

#4

Vaulter - March 28, 2009 - 10:51

There 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.

#5

Vaulter - March 28, 2009 - 10:53
Status:closed» active

#6

Crell - March 30, 2009 - 15:03
Status:active» closed

If 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.

 
 

Drupal is a registered trademark of Dries Buytaert.