summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/database/table_data.rst
blob: 744a0515429b1b7f9662df32cf40934bcdf12c56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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.