Database Metadata

Table MetaData These functions let you fetch table information. List the Tables in Your Database $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; } Determine If a Table Exists $this->db->table_exists(); Sometimes it’s helpful to know whether a particular table exists before running an operation on it.

Web Page Caching

CodeIgniter lets you cache your pages in order to achieve maximum performance. Although CodeIgniter is quite fast, the amount of dynamic information you display in your pages will correlate directly to the server resources, memory, and processing cycles utilized, which affect your page load speeds. By caching your pages, since they are saved in their fully rendered state, you can achieve performance that nears that of static web pages. How Does Caching Work? Caching can be enabled on a per-page

Application Flow Chart

The following graphic illustrates how data flows throughout the system: The index.php serves as the front controller, initializing the base resources needed to run CodeIgniter. The Router examines the HTTP request to determine what should be done with it. If a cache file exists, it is sent directly to the browser, bypassing the normal system execution. Security. Before the application controller is loaded, the HTTP request and any user submitted data is filtered for security. The Controller lo

Tutorial

This tutorial is intended to introduce you to the CodeIgniter framework and the basic principles of MVC architecture. It will show you how a basic CodeIgniter application is constructed in step-by-step fashion. In this tutorial, you will be creating a basic news application. You will begin by writing the code that can load static pages. Next, you will create a news section that reads news items from a database. Finally, you’ll add a form to create news items in the database. This tutorial will

Database Quick Start: Example Code

The following page contains example code showing how the database class is used. For complete details please read the individual pages describing each function. Initializing the Database Class The following code loads and initializes the database class based on your configuration settings: $this->load->database(); Once loaded the class is ready to be used as described below. Note: If all your pages require database access you can connect automatically. See the connecting page for details

Managing your Applications

By default it is assumed that you only intend to use CodeIgniter to manage one application, which you will build in your application/ directory. It is possible, however, to have multiple sets of applications that share a single CodeIgniter installation, or even to rename or relocate your application directory. Renaming the Application Directory If you would like to rename your application directory you may do so as long as you open your main index.php file and set its name using the $applicatio

CodeIgniter Overview

The following pages describe the broad concepts behind CodeIgniter: Getting Started CodeIgniter at a Glance Supported Features Application Flow Chart Model-View-Controller Architectural Goals

CI_URI::uri_string()

uri_string() Returns: URI string Return type: string Returns a string with the complete URI. For example, if this is your full URL: http://example.com/index.php/news/local/345 The method would return this: news/local/345

CI_DB_driver::table_exists()

table_exists($table_name) Parameters: $table_name (string) – The table name Returns: TRUE if that table exists, FALSE if not Return type: bool Determine if a particular table exists.

unix_to_human()

unix_to_human([$time = ''[, $seconds = FALSE[, $fmt = 'us']]]) Parameters: $time (int) – UNIX timestamp $seconds (bool) – Whether to show seconds $fmt (string) – format (us or euro) Returns: Formatted date Return type: string Takes a UNIX timestamp as input and returns it in a human readable format with this prototype: YYYY-MM-DD HH:MM:SS AM/PM This can be useful if you need to display a date in a form field for submission. The time can be formatted with or without seconds, and i