blob: 744a0515429b1b7f9662df32cf40934bcdf12c56 [file] [log] [blame]
Derek Jones8ede1a22011-10-05 13:34:52 -05001##########
2Table Data
3##########
4
5These functions let you fetch table information.
6
7$this->db->list_tables();
8==========================
9
10Returns an array containing the names of all the tables in the database
11you are currently connected to. Example::
12
Joseph Wensleyf24f4042011-10-06 22:53:29 -040013 $tables = $this->db->list_tables();
14
15 foreach ($tables as $table)
16 {
17 echo $table;
18 }
Derek Jones8ede1a22011-10-05 13:34:52 -050019
20$this->db->table_exists();
21===========================
22
23Sometimes it's helpful to know whether a particular table exists before
24running an operation on it. Returns a boolean TRUE/FALSE. Usage example::
25
Joseph Wensleyf24f4042011-10-06 22:53:29 -040026 if ($this->db->table_exists('table_name'))
27 {
28 // some code...
29 }
Derek Jones8ede1a22011-10-05 13:34:52 -050030
Joseph Wensleyf24f4042011-10-06 22:53:29 -040031.. note:: Replace *table_name* with the name of the table you are looking for.