From 3b11868b3aa56c83419d904435a5b7dfbf997063 Mon Sep 17 00:00:00 2001
From: Derek Allard
Date: Tue, 22 Jan 2008 23:44:32 +0000
Subject: Added $this->db->dbprefix() to manually add database prefixes.
---
user_guide/changelog.html | 1 +
user_guide/database/queries.html | 4 ++++
2 files changed, 5 insertions(+)
(limited to 'user_guide')
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index 66aa63539..8b086fb44 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -88,6 +88,7 @@ Change Log
Other Database Related
- Added $this->DB->save_queries variable to DB driver, enabling queries to get saved or not. Previously they were always saved.
+ - Added $this->db->dbprefix() to manually add database prefixes.
- Added 'random' as an order_by() option , and removed "rand()" as a listed option as it was MySQL only.
- Added a check for NULL fields in the MySQL database backup utility.
- Added "constrain_by_prefix" parameter to db->list_table() function. If set to TRUE it will limit the result to only table names with the current prefix.
diff --git a/user_guide/database/queries.html b/user_guide/database/queries.html
index 7e9d05d7b..19b33d5e1 100644
--- a/user_guide/database/queries.html
+++ b/user_guide/database/queries.html
@@ -80,6 +80,10 @@ It DOES NOT return a database result set, nor does it set the query timer, or co
It simply lets you submit a query. Most users will rarely use this function.
+Adding Database prefixes manually
+If you have configured a database prefix and would like to add it in manually for, you can use the following.
+$this->db->dbprefix('tablename');
+// outputs prefix_tablename
Protecting identifiers
In many databases it is advisable to protect table and field names - for example with backticks in MySQL. Active Record queries are automatically protected, however if you need to manually protect an identifier you can use:
$this->db->protect_identifier('table_name');
--
cgit v1.2.3-24-g4f1b