summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/database/table_data.rst
diff options
context:
space:
mode:
authorEric Barnes <eric@ericlbarnes.com>2011-11-27 06:30:22 +0100
committerEric Barnes <eric@ericlbarnes.com>2011-11-27 06:30:22 +0100
commit7e66dda705743cbfe1d522ddb73e5694006ec42c (patch)
treec08b63deb28c09ec49d9173280f1ca234debfe50 /user_guide_src/source/database/table_data.rst
parent7eceb03f083643254c7393c6b5ebe539e344a1ba (diff)
parente101593561a10632c1d63180436b19f1d7115046 (diff)
Merge branch 'refs/heads/develop' into feature/unit-tests
Conflicts: user_guide/helpers/number_helper.html
Diffstat (limited to 'user_guide_src/source/database/table_data.rst')
-rw-r--r--user_guide_src/source/database/table_data.rst31
1 files changed, 31 insertions, 0 deletions
diff --git a/user_guide_src/source/database/table_data.rst b/user_guide_src/source/database/table_data.rst
new file mode 100644
index 000000000..744a05154
--- /dev/null
+++ b/user_guide_src/source/database/table_data.rst
@@ -0,0 +1,31 @@
+##########
+Table Data
+##########
+
+These functions let you fetch table information.
+
+$this->db->list_tables();
+==========================
+
+Returns an array containing the names of all the tables in the database
+you are currently connected to. Example::
+
+ $tables = $this->db->list_tables();
+
+ foreach ($tables as $table)
+ {
+ echo $table;
+ }
+
+$this->db->table_exists();
+===========================
+
+Sometimes it's helpful to know whether a particular table exists before
+running an operation on it. Returns a boolean TRUE/FALSE. Usage example::
+
+ if ($this->db->table_exists('table_name'))
+ {
+ // some code...
+ }
+
+.. note:: Replace *table_name* with the name of the table you are looking for.