return queries("INSERT INTO " . table($table) . ($set ? " (" . implode(", ", array_keys($set)) . ")\nVALUES (" . implode(", ", $set) . ")" : "DEFAULT VALUES"));
}
+ function last_id() {
+ global $connection;
+ return $connection->result("SELECT SCOPE_IDENTITY()"); // @@IDENTITY can return trigger INSERT
+ }
+
function explain($connection, $query) {
$connection->query("SET SHOWPLAN_ALL ON");
$return = $connection->query($query);
return queries("INSERT INTO " . table($table) . " (" . implode(", ", array_keys($set)) . ")\nVALUES (" . implode(", ", $set) . ")");
}
+ /** Get last auto increment ID
+ * @return string
+ */
+ function last_id() {
+ global $connection;
+ return $connection->result("SELECT LAST_INSERT_ID()"); // mysql_insert_id() truncates bigint
+ }
+
/** Explain select
* @param Min_DB
* @param string
return queries("INSERT INTO " . table($table) . ($set ? " (" . implode(", ", array_keys($set)) . ")\nVALUES (" . implode(", ", $set) . ")" : "DEFAULT VALUES"));
}
+ function last_id() {
+ return 0; // there can be several sequences
+ }
+
function explain($connection, $query) {
return $connection->query("EXPLAIN $query");
}
return queries("INSERT INTO " . table($table) . ($set ? " (" . implode(", ", array_keys($set)) . ")\nVALUES (" . implode(", ", $set) . ")" : "DEFAULT VALUES"));
}
+ function last_id() {
+ global $connection;
+ return $connection->result("SELECT LAST_INSERT_ROWID()");
+ }
+
function explain($connection, $query) {
return $connection->query("EXPLAIN $query");
}
}
query_redirect("UPDATE" . limit1(table($TABLE) . " SET" . implode(",", $set) . "\nWHERE $where"), $location, lang('Item has been updated.'));
} else {
- queries_redirect($location, lang('Item has been inserted.'), insert_into($TABLE, $set));
+ $result = insert_into($TABLE, $set);
+ $last_id = ($result ? last_id() : 0);
+ queries_redirect($location, lang('Item%s has been inserted.', ($last_id ? " $last_id" : "")), $result); //! link
}
}
}
'Create new table' => 'Vytvořit novou tabulku',
'Item has been deleted.' => 'Položka byla smazána.',
'Item has been updated.' => 'Položka byla aktualizována.',
- 'Item has been inserted.' => 'Položka byla vložena.',
+ 'Item%s has been inserted.' => 'Položka%s byla vložena.',
'Edit' => 'Upravit',
'Insert' => 'Vložit',
'Save and insert next' => 'Uložit a vložit další',
Allow semicolon as CSV separator
Autofocus username in login form
Disable spellchecking in SQL textareas
-Japanese translation
+Display auto_increment value of inserted item
Link table names in SQL queries
+Japanese translation
Defer table information in database overview to JavaScript (performance)
Big tables optimizations (performance)