From 9b23008a4adc890f4da64971232eca30c43c6271 Mon Sep 17 00:00:00 2001 From: Dries Buytaert <dries@buytaert.net> Date: Mon, 6 Oct 2008 10:56:35 +0000 Subject: [PATCH] - Patch #300239 by Crell: updated documentation of db_insert(). --- includes/database/query.inc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/includes/database/query.inc b/includes/database/query.inc index 4abcc2037351..ab0e623e73d2 100644 --- a/includes/database/query.inc +++ b/includes/database/query.inc @@ -360,6 +360,10 @@ public function useDefaults(Array $fields) { * If the database does not support delayed INSERT queries, this method * has no effect. * + * Note that for a delayed query there is no serial ID returned, as it won't + * be created until later when the query runs. It should therefore not be + * used if the value of the ID is known. + * * @param $delay * If TRUE, this query is delay-safe and will run delayed on supported databases. * @return @@ -376,7 +380,9 @@ public function delay($delay = TRUE) { * @return * The last insert ID of the query, if one exists. If the query * was given multiple sets of values to insert, the return value is - * undefined. + * undefined. If the query is flagged "delayed", then the insert ID + * won't be created until later when the query actually runs so the + * return value is also undefined. */ public function execute() { -- GitLab