Posts

Showing posts with the label Active Record in CodeIgniter

Active Record in CodeIgniter | PHP Gurukul

Image
  CodeIgniter uses a modified version of the Active Record Database Pattern. This pattern allows information to be retrieved, inserted, and updated in your database with minimal scripting. In some cases only one or two lines of code are necessary to perform a database action. CodeIgniter does not require that each database table be its own class file. It instead provides a more simplified interface. Selecting data All of the functions in this section will build SQL SELECT queries. All of the SQL in this section is MySQL; other database systems may differ slightly. $this->db->get(); The simplest query that you can do with Active Record is to select a full database table. This is done with one single function:   1 $ this -> db -> get ( ) ; This would create the SQL query:   1 SELECT * FROM ` table_name ` ; This function has three parameters. The first is the name of the database table. The second lets you set a limit, and the third lets you set an offset. ...