I am studying codeigniter by developing a website locally. My doubt is, I added some fields in table as unique.
When I try to add duplicate values, It shows internal server error
I overcome this by add function for check if it is a duplicate entry. But I need to add this function on each table insertion.
My question is, Is there any way to write a function at My_model.php for check a table and a unique field value and call it in the My_controller.php by passing the table name and unique field value