CodeIgniter User Guide Version 2.2.6 |
Table of Contents Page |
CodeIgniter Home › User Guide Home › Database Library › Table Data |
These functions let you fetch table information.
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;
}
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.
Previous Topic: Transactions · Top of Page · User Guide Home · Next Topic: Field Metadata
CodeIgniter · Copyright © 2006 - 2014 · EllisLab, Inc. · Copyright © 2014 - 2015 · British Columbia Institute of Technology