comman model for codeigniter which can use very easy also its codeoptimise and time consumption.
Download and drag the General_model.php file into your application/core folder. CodeIgniter will load and initialise this class automatically for you.
Extend your model classes from General_model and all the functionality will be baked in automatically.