The R of CRUD represents the process to select data from a database. CodeIgniter uses the $this->db->get()
database function to fetch rows from the database. Its usage is explained in the following sections.
The following is the SQL code required to support this recipe; you'll need to adapt it to your circumstances.
CREATE TABLE IF NOT EXISTS `ch6_users` ( `id` int(11) NOT NULL AUTO_INCREMENT, `firstname` varchar(50) NOT NULL, `lastname` varchar(50) NOT NULL, `username` varchar(20) NOT NULL, `password` varchar(20) NOT NULL, `created_date` int(11) NOT NULL, `is_active` varchar(3) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; INSERT INTO `ch6_users` (`firstname`, `lastname`, `username`, `password`, `created_date`, `is_active`) VALUES ('claire', 'Strickland', 'cstrickland', 'password', 1366114115, 'yes'), ('Douglas', 'Morrisson', 'dmorrisson', 'password', 1366114115, 'yes'), ('Jessica'...